Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- var grounded = false;
- function Start () {
- }
- function Update () {
- if (Input.touchCount > 0){
- if (grounded == true){
- GetComponent.<Rigidbody>().AddForce(0,250,0);
- grounded = false;
- }
- }
- if (Input.GetKeyDown("space")){
- if (grounded == true){
- GetComponent.<Rigidbody>().AddForce(0,250,0);
- grounded = false;
- }
- }
- }
- function OnCollisionEnter(hit: Collision) {
- grounded = true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement