Fix range enemy rotation
This commit is contained in:
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
public partial class FireAtPlayer : Timer
|
||||
{
|
||||
[Export]
|
||||
private Area3D _enemy;
|
||||
private StaticBody3D _enemy;
|
||||
[Export]
|
||||
private PackedScene _fireProjectile;
|
||||
|
||||
@@ -16,7 +16,7 @@ public partial class FireAtPlayer : Timer
|
||||
var convertedPlayers = players.Select(x => (Node3D)x);
|
||||
var target = convertedPlayers.OrderBy(x => _enemy.Position.DistanceTo(x.Position)).FirstOrDefault();
|
||||
var projectile = _fireProjectile.Instantiate<Projectile>() as EnemyBullet;
|
||||
projectile.Rotation = _enemy.Rotation;
|
||||
projectile.Rotation = new Vector3(0, _enemy.Rotation.Y, 0);
|
||||
projectile.Position = _enemy.Position;
|
||||
GetParent().AddChild(projectile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user