- Home /
Unknown Identifier maxSlope
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;
}
}
Error Assets/Jump.js(16,9): BCE0005: Unknown identifier: 'maxSlope'.
I can't get maxSlope to work
Thanks
Answer by robertbu · Oct 09, 2013 at 03:03 PM
Are you borrowing this code from somewhere else? If so, please provide a reference to the original code. As for your error, maxSlope is not declared anywhere. You can solve your problem by putting something like this at the top of the file:
var maxSlope = 45.0;
I have no idea with the right value of maxSlope should be for your use.
Thank You Thank You Thank You Thank You It is so funny how i can miss so many small mistakes
I'm using the script from youtube https://www.youtube.com/watch?v=eSnzuRgrN_8
Thanks for your help
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
HealthPack Script Problem... 1 Answer
jump animation doesn't play all the way if i am moving 1 Answer
what is the jump axis for if (Input.GetAxis(" ? ") 2 Answers
Getting Unknown Identifier Error 1 Answer