So i am trying to make my character jump with gravitation - and I get the message;
"Expression in Statement must only be executed for the side-effects"
I think this means that my code does not DO anything… can somebody help me figure out what is wrong?
var JumpH = 8;
var isFalling = false;
var jumpForce = 10;
var gravitasjon = -15;
function Update () {
if (GameObject.Velocity.y < 0.29);
{
rigidbody.AddForce.y * gravitasjon;
}
}
function FixedUpdate () {
if (Input.GetKey ("space") && isFalling == false)
{
rigidbody.velocity.y = JumpH;
isFalling = true;
}
}
function OnColissionStay ()
{
isFalling = false;
}
I also tried adding (… gravitasjon * Time.deltaTime) and nothing… any thoughts?