I’m almost new in unity but not so noob.
if I call this in FixedUpdate or Update, it works perfectly.
This is my code:
void ChickenJump(){
print ("touch");
if (Grounded&&Input.GetKeyDown(KeyCode.Space)) {
chickenbody.velocity = new Vector2 (0.0f, jumpRange);
}
but if I use this code and called with a button, it does’t work!
public void ChickenJump(){
print ("touch");
if (Grounded) {
chickenbody.velocity = new Vector2 (0.0f, jumpRange);
}
}
The print is showing, meaning it is called, but the jump does’t work!
please help…
And is Grounded true?
– tanoshimiHow do you check if object is grounded?
– arthymon