character wedged between objects

Posted By: Dooley

character wedged between objects - 04/22/18 00:15

I am having a problem where some objects appear close together, and the player can attempt to jump or climb in between them. When he gets about half way through, he gets stuck. He is wedged in between two sloped surfaces and can no longer move.

I have attempted to use "in_solid" to prevent this, but that does not seem to be the problem. The conditions do not actually place the character inside of the solid objects.

Is there a way to prevent this (outside of using a standard hull for collisions - as I want the player to be able to walk on these surfaces normally via polygon collision)?

Is there a way to detect this kind of wedging?

I am just looking for some kind of general example at this point, an arrow in the right direction if possible...
Posted By: Kartoffel

Re: character wedged between objects - 04/22/18 08:32

I guess in your movement code your player is marked as falling/sliding in that case?
You could do it the Borderlands way and check if the player doesn't change position significantly while in these states for a second or so. Then just allow them to jump and you should be able to get out of there.

In general you should try to keep the possibility from that to happen low.
Posted By: Dooley

Re: character wedged between objects - 04/23/18 05:38

I opted to give the player a jet pack. It's a space game, and I was considering that anyway. So the player does not have to be standing on the ground to jump anymore, and it solved the problem.
© 2024 lite-C Forums