I have one Player with RigidBody2D and a pillar with BoxCollider2D.
I check when OnTriggerEnter2D is called ( Player collided with the pillar ) then I try to keep Player position by change his bodyType to Static.
When OnTriggerExit2D is called, Player bodyType will be reverted to Dynamic again.
My problem is: after change player bodyType to Static , OnTriggerExit2D is called immediately. And after reverted to Dynamic, then OnTriggerEnter2D is called immediately. It goes on repeating again and again.
This is my Player and pillar
If you have any suggest please tell me.
Thank you.
