Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var pulo : int = 60;
- if(Input.GetButtonDown("Jump") && Chao)
- {
- GetComponent.<Rigidbody2D>().velocity.y = pulo;
- }
- if(Input.GetButtonUp("Jump") && !Chao && GetComponent.<Rigidbody2D>().velocity.y >0)
- {
- GetComponent.<Rigidbody2D>().velocity.y = GetComponent.<Rigidbody2D>().velocity.y/2;
- }
- //usei Raycasting para detectar o chao, quando os pés do personagem tocar num collider Chao vai ser true etc...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement