Skip to content

CharacterVirtual experiences jittery behavior when jumping in obtuse corners #1044

Answered by jrouwe
a-day-old-bagel asked this question in Q&A
Discussion options

You must be logged in to vote

I'm aware of this behavior. It is a result of the sliding code:

The picture above shows the situation from above, in 1 frame it is possible that the character follows the indicated path to slide along both surfaces. The next frame, the user would still press the forward key and it would slide back again over the same 2 surfaces, causing an oscillation.

Currently the only condition that stops sliding is if the velocity reverses when it hits a surface:

else if (velocity.Dot(last_velocity) < 0.0f)

but that's not happening here since it changes velocity 2x. I remember playing around with this a lot …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@a-day-old-bagel
Comment options

Answer selected by a-day-old-bagel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants