So i was on youtube seeing a tutorial of how to make a platformer unity game i did this code and it dosen’t seem to work
using UnityEngine;
using System.Collections;
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 {1, jumpHeight};
}
}
}