void Update() { Sprint.Process(); var target = Vector3.forward * Input.Move.y + Vector3.right * Input.Move.x; target = Vector3.ClampMagnitude(target, 1f); target *= speed * Sprint.Multiplier; target.y = rigidbody.velocity.y; rigidbody.velocity = Vector3.MoveTowards(rigidbody.velocity, target, acceleration * Time.deltaTime); Animate(); }
protected override void Process() { if (Input.Aim.Value) { return; } base.Process(); var target = CalculateVelocityTarget(); Velocity = Vector3.MoveTowards(Velocity, target, acceleration * Time.deltaTime); SetAnimatorVelocity(Velocity); Rotation.Process(Velocity); Sprint.Process(); ApplyVelocity(Animator.velocity); }