- Home /
Disable a diffrent collision
Id want to disable a collision of another objects, not the one that the script is connected to. how??
Is this a 3D collision or 2D that you want to disable?
You either make a variable in your script that you assign your object to and disable it's collider, or you search for it with a tag, type or name (a tad dangerous sometimes) and then disable it. Search for "accessing components in other objects".
isnt there like a collider.enabled = false; but (variable)collider.enabled = false;
This may help you ....
 var object :GameObject;
 function Update (){
 object.gameobject.collider.enabled =false;
 }
Answer by SuperReaper1999 · Dec 15, 2014 at 01:47 PM
since you're using 2D the code would look like this
  var object :GameObject;
 
  function Start (){
      object.collider2D.enabled = false;
  }
 
this will disable the collider when you press the play button!
Your answer
 
 
             Follow this Question
Related Questions
OnCollisionEnter Push Object Problem 0 Answers
Unity 2D Colliders not Colliding 2 Answers
Collision with renderer.enabled? 0 Answers
Sound on collision 3 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                