- Home /
 
               Question by 
               $$anonymous$$ · Jan 17, 2018 at 07:42 PM · 
                2dmouseclickfindgameobjectswithtagignorecollision  
              
 
              IgnoreCollision doesnt work?
if i click right mouse button the player and object can collid with each other` GameObject player;
 // Use this for initialization
 void Start () {
     player = GameObject.FindGameObjectWithTag("Player");
 }
 
 // Update is called once per frame
 void Update () {
     if(Input.GetMouseButton(1))
     {
         Physics2D.IgnoreCollision(this.GetComponent<Collider2D>(), player.GetComponent<Collider2D>(), true);
     }else
     {
         Physics2D.IgnoreCollision(this.GetComponent<Collider2D>(), player.GetComponent<Collider2D>(), false);
     }
 }`
               Comment
              
 
               
              Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                