IronWarrior/SuperCharacterController

The "Clashing" Pushback Vectors Issue

Opened this issue · 0 comments

This is an issue regarding the "Pushback" function in the Super Character Controller Class.

If I put two boxes like this:

two boxes

And I try to walk on them, this happens:
https://vid.me/e/Y7Zj

The reason this happens is because the two boxes have opposite Pushback vectors, and since the character is pushed to the right and then to the left, it stands there.

A possible solution to this would be to compare previous pushback vectors to each other, and if they are opposite to each other you would alter the pushback vector in some way, allowing the character to "escape".

If you have in mind a different solution, or if you know how to alter the pushback vector, please leave a comment.

EDIT:

It seems that this isn't a single issue, instead it leads to two different issues.

The character wouldn't actually get "sucked" in the two boxes if there wasn't an issue due to an imprecision in the grounding method, specifically in the "SimulateSphereCast" function.

If this issue was solved, the character wouldn't get stuck between the two boxes, so this issue would be solved.

But what if, in some way, the character gets stuck between those two boxes? (what if, for example, the player spawns between the two boxes?).

This is caused by the other issue regarding the "Pushback" method, which I explained before.