Animation fixes

This commit is contained in:
2024-09-16 20:38:44 -07:00
parent d0c78e54a7
commit 354813e6e0
292 changed files with 6049 additions and 678 deletions

View File

@@ -22,7 +22,8 @@ public partial class EnemyLogic
var targetPosition = enemy.NavAgent.GetNextPathPosition();
var velocity = (targetPosition - enemy.GlobalPosition).Normalized() * 1.0f;
enemy.Velocity = velocity;
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();