Open MrGadget1024 opened 1 month ago
Usage case:
void OnVelRotChanged(Vector3 newVelocity, Vector3 newRotation) { animVelocity = -MathF.Round(transform.InverseTransformDirection(newVelocity).z / moveSpeedMultiplier, 1); animRotation = -MathF.Round(newRotation.y / maxTurnSpeed, 1); if (animator) { animator.SetFloat("Forward", MathF.Round(Mathf.MoveTowards(animator.GetFloat("Forward"), animVelocity, moveSpeedMultiplier * Time.deltaTime), 1)); animator.SetFloat("Turn", MathF.Round(Mathf.MoveTowards(animator.GetFloat("Turn"), animRotation, maxTurnSpeed * Time.deltaTime), 1)); } }
Usage case: