- Home /
Question by
pianoguy04 · Oct 08, 2013 at 11:31 PM ·
errorjumpgrounded
I am having two errors with my jump script
var jumpVelocity : float = 20;
@HideInInspector
var grounded : boolean = false;
function Update ()
{
if (Input.GetButtonDown("Jump"))
rigidbody.AddForce(0,jumpVelocity,0);
}
function OnCollisionStay (collision : Collision)
{
for (var contact : ContactPoint in collision.contacts)
{
if (Vector3.Angle(contact.normal, Vector3.up < maxSlope)
grounded = true;
}
}
errors
Assets/Jump.js(16,13): BCE0044: expecting ), found 'grounded'.
Assets/Jump.js(16,22): BCE0043: Unexpected token: =.
And yes i am a Beginner thanks
Comment
Best Answer
Answer by Lukamyte · Oct 08, 2013 at 11:49 PM
Ah, this was easy. On your "if" statement, you missed one end of the parentheses, the right one, so add that on. That should fix your second problem too.
Thanks
But now I have an error saying $$anonymous$$ identifier: 'maxSlope'.
I solved the $$anonymous$$ identifier: 'maxSlope' error. The script works.
Thanks
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Unity 3.4.0 Running really slow 1 Answer
Script is not working at all 2 Answers
Unexpected Token 3 Answers
I need help with animations. 0 Answers