- Home /
Character jumping script without gravity?
Currently, my main character in my game does not have gravity effects turned on at the moment because he falls through the plane he's supposed to be resting on. Instead, I have kinematic checked. Is there a way to prevent my character from falling through the floor with gravity turned on so that I could use a simple AddForce -> upwards? And if not, what would be a method of jumping without the gravity effect checked?
Thanks
Answer by Adamcbrz · Apr 06, 2012 at 04:17 AM
I think these videos will help you with what you want to do. http://www.3dbuzz.com/vbforum/content.php?212
Section 3 has a video on jumping and gravity,
Answer by VitalSignsStudios · Apr 06, 2012 at 06:28 AM
You need to add a collider to the plane in order for your character to not fall though it. You can then make that collider/plane kinematic so that he does not fall through. Then you can simply do:
rigidbody.AddForce (Vector3.up * 10);
or put something like this in one frame:
rigidbody.velocity.y = 7;
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Making player jump when left mouse clicked 1 Answer
How to enable gravity on gameobject when interact by player 3 Answers