- Home /
Trigger behavior between physics(2d) objects
I've got collectable objects and a player object in my game. Both need physics2d to interact with their environment, however I need there to be trigger-like behavior between the two types of objects. In other words I need the physics from the collectables to not push the player around if one happens to fly into him at an angle. I still need the collectables to bounce off each other though. How do I achieve this?
Have you tried marking the coin's colliders as triggers?
But I still need the collectable to have physics interaction with the level. just not with the player. I tried using collision layers but that seems to disable triggers as well Basically I need both types of objects to have physics behavior, just not with each other
You should post that as an answer, because it works and I will accept it. thank you!
Answer by KellyThomas · Dec 22, 2013 at 08:52 AM
I don't know if this is the best solution but one way to do it would be to add a child gameobject to the coin. Give the child gameobject a collider and assign it to a separate physics layer.
You could then set this other collider as a trigger and use collision layers to only check collisions against the player.
You could then use the collisions layers to set the first collider to ignore the player.
Your answer
Follow this Question
Related Questions
Get information on ignored collision 1 Answer
Child object's collider (on a different layer) is interfering with parent Physics... 0 Answers
Unity 5.0 and alternative for triggering complex meshes. 2 Answers
Gun collision problem 3 Answers
ParticleSystem TriggerModule: Collide with world / collide with unlimited colliders? 0 Answers