update animator
This commit is contained in:
@@ -15,6 +15,8 @@ namespace OnlyScove.Scripts
|
||||
stateMachine.Input.OnCrouchEvent += OnCrouch;
|
||||
stateMachine.Input.OnInteractEvent += OnInteract;
|
||||
}
|
||||
private readonly int speedXHash = Animator.StringToHash("Velocity X");
|
||||
private readonly int speedZHash = Animator.StringToHash("Velocity Z");
|
||||
|
||||
public override void Tick(float deltaTime)
|
||||
{
|
||||
@@ -66,6 +68,8 @@ namespace OnlyScove.Scripts
|
||||
}
|
||||
|
||||
stateMachine.Anim.SetFloat(speedHash, 0.7f, stateMachine.AnimationDamping, deltaTime);
|
||||
stateMachine.Anim.SetFloat(speedXHash, input.x * 0.5f, stateMachine.AnimationDamping, deltaTime);
|
||||
stateMachine.Anim.SetFloat(speedZHash, input.y * 0.5f, stateMachine.AnimationDamping, deltaTime);
|
||||
}
|
||||
|
||||
public override void PhysicsTick(float fixedDeltaTime) {}
|
||||
|
||||
Reference in New Issue
Block a user