Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class salto : MonoBehaviour {
  5. private Vector3 jump;
  6. // Use this for initialization
  7. void Start () {
  8.  
  9. }
  10.  
  11. // Update is called once per frame
  12. void Update () {
  13.  
  14. if (Input.GetKeyDown (KeyCode.Space)) {
  15. jump=transform.position+ new Vector3(0,5,0);
  16. transform.Translate(jump*Time.deltaTime);
  17. }
  18. if (Input.GetKey (KeyCode.Space)) {
  19. jump=transform.position+ new Vector3(0,5,0);
  20. transform.Translate(jump*Time.deltaTime);
  21. }
  22. if (Input.GetKeyUp (KeyCode.Space)) {
  23. jump=transform.position+ new Vector3(0,5,0);
  24. transform.Translate(jump*Time.deltaTime);
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement