Question by
bluenblu · Jun 02, 2021 at 01:40 PM ·
3djumping object
what should i do for jumping at unity 3D?
I want to make my character jump but don't know what should i do.
When I tap spacebar, my character is fly away to the moon like this
https://answers.unity.com/storage/temp/181558-fail.gif
and this is my code:
if (Input.GetKeyDown("space"))
{
GetComponent<Rigidbody>().AddForce(Vector3.up * jump, ForceMode.Impulse);
}
fail.gif
(486.7 kB)
Comment
Your answer
Follow this Question
Related Questions
addForce problem please help! 2 Answers
How to control GameObjects by Button and Script 0 Answers
Animation on raycast enter trigger ? 0 Answers
Random Generation problem GameObject 0 Answers