- Home /
Ignoring collision on a specific parent or a tagged object
I have my level spawning around my player as he goes, as such the enemies are inside the levelpieces that are spawned, as well as several other things
Physics.IgnoreCollision(instantiatedProjectile.collider, transform.root.collider);
that line works for the players collision to be ignored by his own projectiles, but all the enemies look to the root of the levelpiece for a collider, how do I make the enemies only look for a specific object to ignore collison on, or say a tagged object like other enemies, or just its own parent.
Answer by QuestionBro · May 06, 2011 at 01:50 AM
Nevermind, fixed it with a messy quick fix for now
Physics.IgnoreCollision(instantiatedProjectile.collider, transform.parent.transform.parent.transform.parent.collider);
I just go several parents up for now but I will have to make it more precise.
Your answer
Follow this Question
Related Questions
Ignore individual collisions between two objects 1 Answer
making Navmesh Agents able to walk through each other? 3 Answers
Why does my player object decide to ignore colliders whenever he feels like it? c# 1 Answer
Instantiated Projectile IgnoreCollision Error 0 Answers
How to detect if collisions are being ignored unity 2018 2 Answers