Issue on stoping player’s speed after it respawns from the death

Updated on June 7, 2018 in  [R] Scripts
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
1 on June 7, 2018

Hello everyone, I have an issue, after my player(sphere object) respawns back at the game from the death(it dies if it falls from the tail),the player speed force it remains and when it respawns my player continues the movement. How can I control or make the force of the player (sphere object) to stop and wait for the user to move it?

  • Liked by
Reply
0 on June 7, 2018

If you’re using Unity’s rigidbodies, you can just set the velocity to 0

GetComponent<Rigidbody>().velocity = Vector3.zero;

 

  • Liked by
Reply
Cancel