Quantcast
Channel: Questions in topic: "ignorecollision"
Viewing all articles
Browse latest Browse all 148

[2D] Is it possible to un-ignore collisions between colliders?

$
0
0
Hello everyone! I am creating a game in which, at certain moment, I need to make the player ignore certain colliders, for this I have implemented this simple code based on game object tag: public GameObject player; GameObject[] allGameObjects; allGameObjects=GameObject.FindGameObjectsWithTag("tag_GameObjectToIgnore"); foreach (GameObject GameObjectToIgnore in allGameObjects) Physics2D.IgnoreCollision(player.GetComponent(), GameObjectToIgnore.GetComponent()); Then, after some seconds I need the player to collide again with all those "GameObjectToIgnore". Is there any method to undo the "Physics2D.IgnoreCollision"? Thanks!

Viewing all articles
Browse latest Browse all 148

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>