-
-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make KinematicCharacterController move along obstacles, respect offset more and fix false positives in grounded detection #446
Conversation
|
The revert This is not a regression since the main branch suffers from the same issue (see #418). I guess this might be a conceptual problem: the platform might try to fill the gap left by the offset, thus moving the character up. The character then tries to move down again, causing the jitter. This is just a guess, but if this is really the cause, I'm really unsure how one could fix this in the future. There is some jittering left when near the center of the platform, but that was also present already. As for the autostopping: I think one of the reverts fixed it because I cannot reproduce it. |
@sebcrozet I addressed your concerns, ready for another review 🚀 |
I just checked out your branch to see if it would fix some issues I was having with the KinematicCharacterController(offset not being respected and getting stuck to walls). It did fix those problems, but introduced a few others. Lot's of jitter and very odd interactions with moving platforms. |
@morbidbark that's a bummer. I did see some jitter as well, but it's hard to tell how much of that was already present and not noticeable because before the character didn't move at all in many of these situations. I tried looking further into it, but I'm at a loss here. |
So I played around with it a little more today and found that when standing still on solid ground my CharacterController is constantly switching between the grounded and falling state. However, when I ran the character_controller2 example and monitored the grounded attribute on EffectiveCharacterMovement it appeared to be stable. It looks like my problems are probably just user error. |
I was able to verify that my jittering problems were due to user error. I had frames where my "gravity" was not acting on my controller causing it to appear ungrounded. The issues I was having with the moving platforms is still there, but this also happens on the latest release so not a problem with this PR. Sorry for any confusion. |
Glad to hear 😄 |
Hey @janhohenheim! Taking a closer look at Now, the new slope handling code does the following: if climbing {
// Are we allowed to climb?
(angle_with_floor <= self.max_slope_climb_angle).then_some(horizontal_translation)
} the comparison is incorrect here as it reads "if the floor is angles by less than
What if we fixed that check with a I think we can have the In addition, having I don’t want to delay this PR further so I’ll make a commit for these observations and merge the PR. We can still improve it further later if these suggestions still have issues. |
Fantastic work @janhohenheim, thanks again! |
@sebcrozet no worries, hope you enjoyed your vacation :) |
PR contents: