#pragma strict
function Jump () {
if (Input.GetButtonDown ("Jump"));
rigidbody2D.AddForce (Vector3.up);
}
When I press spacebar nothing happens, I’ve tried to change everything I can and it won’t work.
#pragma strict
function Jump () {
if (Input.GetButtonDown ("Jump"));
rigidbody2D.AddForce (Vector3.up);
}
When I press spacebar nothing happens, I’ve tried to change everything I can and it won’t work.
if (Input.GetButtonDown (“Jump”));
rigidbody2D.AddForce (Vector3.up);
Should go inside of
function Update()
{
}
edit: Also, the correct code should be
if (Input.GetButtonDown ("Jump"))
{
rigidbody2D.AddForce (Vector3.up);
}