Hi, I’m new to programming in Javascript, and I’m having an issue with my script.
It won’t compile; instead Unity says “‘hitGround’ is not a member of ‘Collide’”.
I can’t figure this out. Can someone help me?
This is the script (named Collide.js) I made:
pragma strict
{
private var hitGround : boolean = true;
}
function Start ()
{
var hitGround = true;
}
function OnCollisionEnter(groundCollide : Collision)
{
if(groundCollide.gameObject.tag == "floor")
this.hitGround = true;
else
{
this.hitGround = false;
}
}
function Update ()
{
if(this.hitGround == true)
{
canJump = true;
}
else {}
}