Hello, my character is supposed to be able to jump with a rigidbody.velocity script. I have a rigidbody component for character, but it still won’t do anything. Also the console shows no errors. What is wrong?
//jumping
if(canJump == true){
rigidbody2D.velocity.y =10;
Debug.Log("This Shows up")
}
}
function OnCollisionStay2D(coll: Collision2D) {
if(coll.gameObject.tag == "Terrain" && Input.GetKeyDown(KeyCode.W)){
canJump = true;
}
else{
canJump = false;
}
}
I’m pressing “w” , and the log shows up, but my character does not jump. Please help, this has been stumping me for the past few days.
UPDATE UPDATE
The programming part look’s like it has no problems. Here’s my project so you can see.
https://www.mediafire.com/?ro0rmr0lx28epgo
A and D - left/right
W - Should make you jump if we get the problem figured out.
Yeah, and I know it’s simple. Just testing out things really.
Thank you.