- Home /
OnTriggerEnter2D not triggering when on animated object
I have an object thats animated to come up from the ground and is supposed to kill the player once they touch it. But when the player stands on it and it goes up through the player, the player doesnt get killed. The player only gets killed if they move while in it. I am using an OnTriggerEnter on the object to test if the player is in its box collider.
It seems the OnTriggerEnter2d only gets updated when the player moves. How do I fix this/find an alternative?
Thanks.
I havent. This seems to solve it though. I'll try it out later.
Do you put a if statement in to check if it's collided with player cos if the object is co$$anonymous$$g up through ground it's already colliding with the ground so it won't detect the player .
Answer by GiyomuGames · Jan 25, 2016 at 07:09 AM
First you should check whether the player and your object both have rigid bodies. This may be the reason it is working erratically.
The player does, yes. How am I supposed to work around this?
Try adding a rigid body to the other object and set it as "$$anonymous$$inematic". Then check if it corrects your problem :)
Your answer
Follow this Question
Related Questions
Child Trigger event on parent Script 1 Answer
OnTriggerEnter2D Not Working 1 Answer
OnTriggerEnter2D is not being called 1 Answer
score display not showing 1 Answer