Animation fixes
This commit is contained in:
@@ -20,7 +20,8 @@ namespace GameJamDungeon
|
||||
var targetPosition = enemy.NavAgent.GetNextPathPosition();
|
||||
|
||||
enemy.Velocity = (targetPosition - enemy.GlobalTransform.Origin).Normalized() * 2f;
|
||||
enemy.Rotation = new Vector3(0, (float)Mathf.LerpAngle(enemy.Rotation.Y, Mathf.Atan2(enemy.Velocity.X, enemy.Velocity.Z), delta * 10.0), 0);
|
||||
var lookAtDir = enemy.GlobalTransform.Origin - enemy.Velocity;
|
||||
enemy.LookAt(new Vector3(lookAtDir.X, enemy.GlobalPosition.Y, lookAtDir.Z));
|
||||
|
||||
Output(new Output.MovementComputed());
|
||||
return ToSelf();
|
||||
|
||||
Reference in New Issue
Block a user