Question by
Jawsh007 · Jun 18, 2017 at 09:16 AM ·
error message
Why is this not working?
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<Rigidbody2D>().velocity = new Vector2(GetComponent<Rigidbody2D>().velocity.x, jumpHeight);
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Error Using UCE0001: ';' expected. Insert a semicolon at the end. 1 Answer
How to fix (NullReferenceException: Object reference not set to an instance of an object) in my case 0 Answers
What does this error mean? 1 Answer
public UnityEngine.UI.Text fixing errors. 1 Answer
fatal error checkdisalowAllocation. Allocating memeort when it is not allowed to allocate memory 4 Answers