- Home /
Question by
mzaidan1996 · Jul 24, 2020 at 09:51 AM ·
scripting problemmovementscript.speednewbie
How do I slow down while Im Sliding?
So I'm creating a game right now with alot of movement flexibility and its mainly about speed, currently, I am working on creating a slide button, I already created it and it is working, its just that I'm sliding at that speed constantly, I'd like to slow down my character the long I hold the slide button, anyone know how?
Comment
float slowdownspeed = 0.2f;
public Rigidbody rb;
private void Update()
{
if (isSliding == true && rb.velocity.z > 0) //if my velocity in the z direction is > than 0 and im sliding
rb.velocity -= slowdownspeed; //slows down speed over time
}
Your answer
Follow this Question
Related Questions
Question about moving an object technique 3 Answers
How do I increase the speed of my rigidbody after going down the slope 3 Answers
How do I build up speed while wallrunning? 1 Answer
Slime script? 1 Answer
New to Unity & Scripting, How Do I Create a Movement System Thats About Building Up Speed? 0 Answers