- Home /
OnTriggerEnter2D triggering multiple times when moving around inside the trigger area.
I've got a player GameObject with a kinematic RigidBody2D and a BoxCollider2D on it, along with a water area that has a trigger BoxCollider2D. For some reason, OnTriggerEnter2D() is called on the player even when the player is already inside the water area's collider. If the player doesn't move, then OnTriggerEnter2D() isn't called, but as soon as the player starts moving again OnTriggerEnter2D() is called again. Also, It appears to only be called on the first frame of movement. I'm currently moving the player object via RigidBody2D.MovePosition(). The same also happens if I just set the player GameObject transform position directly.
Any ideas?
@renderling What type of game are you making? Are trying to make sure the player doesn't exit the water?