|
I'm writing a very simple platformer, and i'm trying to get the script that controls the player right. I have the following so far:
There's some piping code for when i add in a lava tile to my platformer, but ignore that for now. Right now, i'm just trying to get my platformer guy to jump: If he is still on a surface, and i press space, he won't jump. The force i'm applying should be enough, yet it doesn't seem to be jumping. What's the recommended way to get something to "jump"?
(comments are locked)
|
|
Rather than applying a force you could try directly altering the velocity:
The ground part is to make sure you're on the ground before you can jump (unless you have some kind of double jump). You might also want to stop auto jumping if you hold down the space key.
(comments are locked)
|
|
If I recall correctly, OnCollisionStay events stop happening if the rigidbody has gone to sleep. Use rigidbody.WakeUp() each FixedUpdate to keep it awake. Ok, thanks, i'll try that and report back.
Apr 03 '10 at 04:24 AM
RCIX
I added that, and it didn't help. Do you have a better suggestion for a jumping method? :)
Apr 04 '10 at 04:23 AM
RCIX
(comments are locked)
|
