this is the script:
object : Transform;
function OnTriggerEnter (other : Collider) {
if(hit.object) { object.enabled = false;
}
}
script gets this error:
(1,1): BCE0044: expecting EOF, found ‘object’.
this is the script:
object : Transform;
function OnTriggerEnter (other : Collider) {
if(hit.object) { object.enabled = false;
}
}
script gets this error:
(1,1): BCE0044: expecting EOF, found ‘object’.
most likely what you are looking for is something like this:
object: Transform;
function OnTriggerEnter(other : Collider) {
if (other.transform == object) {
other.gameObject.SetActiveRecursively(false);
}
}
this will disable/deactivate whatever object is when it is triggered.
You need to use the keyword var at the beginning.
You’re also going to have trouble with
if(hit.object)
That doesn’t mean anything.