I’m trying to play a sound while the player is moving so i came up with this code:
if (step.isPlaying && rb.velocity.magnitude < 0.2) {
step.Pause ();
} else if (!step.isPlaying && rb.velocity.magnitude >= 0.2) {
step.UnPause();
}
But since i’m using transform.Translate to move the character i don’t think rb.velocity.magnitude works that great and it counts as movement if the player rotates, So i tried using rb.AddForce() to move the player but as you can probably tell that didn’t work out too great for me. So whats the best way to get player movement for this situation.