- Home /
How to make a better jump ?
I made a simple movement script, it all works fine only the jump not, if i press space it just teleports up, but i need to move up slower not just teleport. can anyone help ? Here is the code :
 if (Input.GetKeyDown("space"))
         {
             transform.Translate(0, 4, 0);
         }
Answer by $$anonymous$$ · Jan 12, 2020 at 10:12 AM
you can use rigidbody component and change its velocity by code for example
if (Input.GetKeyDown("space")) { getcomponent().velocity = new Vector3 (0,4,0); }
Thank you it works just needed to change to GetComponent().velocity
Your answer
 
 
             Follow this Question
Related Questions
Trying to Add jump to this code. 1 Answer
Why won't my character jump,How do I make my character jump? 2 Answers
Smoothly Jump to mouse position 1 Answer
Sphere get stuck in floor and fails to jump? 1 Answer
How can I make a physics object jump a given height on collision regardless of current velocity? 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                