using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour {
public float moveSpeed;
public float jumpHeight;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(Input.GetKeyDown (KeyCode.Space))
{
GetComponent().velocity = new Vector2(GetComponent().velocity.x, jumpHeight);
}
}
}
↧