- Home /
Other
Help with jump script PLEASE :(
Okay I know how to make a jump script...UNTILL unity 5.0.2 came out and I got it. NOW I can't make this work. This is what I have so far.
Using (yadeeblahblah bla) Float jumpH = 8; Bool isFalling = false;
Void Update()
{ This.gameObject.GetComponent().velocity.y = jumpH; }
It won't work why?
Please format your code using the 101010 button. It's easier to read and copy.
Use
GetComponent<RigidBody>().AddForce(Vector3.up * 500f);
You can use different force modes for, too:
Ok I'll try it. Btw about the 101010 button thing I don't know how id do that seeing in doing this on a phone
You're missing a reference to a rigidbody, Void should be void, This should be this, and you're setting the y component of the velocity to a constant value on every frame - jumping requires acceleration.
Follow this Question
Related Questions
The character fails to jump sometimes 1 Answer
How do you double jump in a 2d game 1 Answer
Why Won't it jump? 1 Answer
How to ground the player after jump animation completes 0 Answers
[C#] JUMP - What i must add to this code to jump? :> 1 Answer