Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class salto : MonoBehaviour {
- private Vector3 jump;
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- if (Input.GetKeyDown (KeyCode.Space)) {
- jump=transform.position+ new Vector3(0,5,0);
- transform.Translate(jump*Time.deltaTime);
- }
- if (Input.GetKey (KeyCode.Space)) {
- jump=transform.position+ new Vector3(0,5,0);
- transform.Translate(jump*Time.deltaTime);
- }
- if (Input.GetKeyUp (KeyCode.Space)) {
- jump=transform.position+ new Vector3(0,5,0);
- transform.Translate(jump*Time.deltaTime);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement