Using Collider Bounds to Insure No Touching!

Hi there,
I have a player, at rest.
His collider, may be touching another collider (for example wall, or water).
If this is the case, I want to move the player, so that his collider bounds, are outside of the object x, collider bounds.

If I know the position of the player and object
If I know the collider of the player and the object
How can I best insure my adjusted player position, has the player collider bounds outside of the objects collider bounds?

In collision event there’s collision normal. Project it on the floor and move player in opposite direction until collision exits.

And if you aren’t using callbacks or casts, use ComputePenetration to get the normal and how much they penetrate by.

1 Like

is this applicable to 2D? If not, which? Currently looking at defaultContactOffset()?
Thanks