-
-
Notifications
You must be signed in to change notification settings - Fork 20.8k
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
is_on_floor() reports inconsistently with move_and_collide() used to stair-step #72822
Comments
I would like to add that this is when using a cylinder collision shape. |
Cylinder collision shapes have many issues – I currently recommend using capsules or better, boxes. |
Well I've tried capsule, and it's even more broken for me, but I'll try box. That said, cylinder would be ideal, as you won't get pushed away from walls when rotating(unless you keep it axis-aligned), and you can still walk along edges without falling off. |
So it does fix the teleporting, but is_on_floor() is still broken, so I still experience some motion stuttering near edges of shapes, even with my workaround _is_on_floor() function. |
This one happens because CharacterBody relies on the slide collision for floor check. Every frame you are teleporting the character to the air, it moves towards the wall that is the next stair, which is not a floor, then move downs, which does not update is_on_floor(). What is needed here is a way to force a floor detection check to manually update it after custom behaviour. |
Thanks for the info! And yeah, not sure how to go about that. That said, there is now a shape-collider, which can be used to implement the same sort of behavior without moving the characterbody around, though I don't know if the effects are 1:1, though, from what I've heard so far, they appear to be. That said, that still leaves the jitter, but that also appears to crop up with this stair-stepping code. |
If you are referring to separation rays they are not a good alternative for this, they lack the surface area required to work and the way they separate the body will push it trough geometry on the ceiling if you get over a stair which does not have enough space over you. |
No, I'm talking about shapecast. It's a single cast, but rather than a ray, it's a 3d shape in a straight line. |
Godot version
4.0
System information
Manjaro Linux
Issue description
When implementing stair-stepping similar to how Quake handles it, is_on_floor() seems to report inconsistently, seeming to flip-flop between the two every _physics_process() tick.
Steps to reproduce
Surround your move_and_slide() with a move_and_collide(step_height_vector) before and a move_and_collide(-step_height_vector).
Minimal reproduction project
https://share.internxt.com/d/sh/file/c585190d7d9735382cbe/ec92284f02eb5c30d40d0962606054f4f124638a96392993ddc65469885b5896
The text was updated successfully, but these errors were encountered: