- Home /
Checking for collisions before changing layers
In my game, the player has an action that can make his character temporary immune to certain object collisions. I achieve that by moving the character to a layer that has collision detection disabled against the layer that contains the objects I don't want the player to collide with. However, sometimes the character returns to it's original layer when it's positioned inside an object it can now collide with, causing some weird physics.
So, how can I check if the player character will collide with something before I actually change it's layer?
Comment