- Home /
Disable script
I have the following script attached to a collider called collider1: function Update(){ if(Collision.GameObject("Collision")); (GetComponent(test) as test).enabled = true; }
It is supposed to disable a script named test.
Comment
Answer by 73cn0109y · Aug 19, 2013 at 03:25 AM
Use the OnTriggerEnter() function
function OnTriggerEnter(other: Collider){
if(other.name == "Name"){
other.gameObject.GetComponent(ScriptName).enabled = false;
}
}
Your answer
Follow this Question
Related Questions
Disable a script on collision 2 Answers
How Can One Collider Recognize Contact With Another? 0 Answers
Checking Object Collision Without Script 1 Answer
Helicopter Crash Collision 0 Answers
how do i disable all scripts apart from this one ? 3 Answers