-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
MoveAndSlide / IsOnFloor and MoveAndCollide don't work in C# scripts #19898
Comments
I've tried |
Try to call IsOnFloor after MoveAndSlide. Also increacing gravity acceleration and KinematicBody's safe margin seems to have effect on IsOnFloor behavior, you can play around and tweak. But still, none of this worked for me in case of colliding walls while standing on the floor, IsOnFloor seems to be flickering from true to false randomly. So I ended up replacing it with Raycast node until it's fixed, seems to be working well for now. |
@int010h I tried what you suggested, but the changes still did not have an effect on the outcome. I will likely try to work around the issue like you recommended, though it was sort of important for me to report it. |
This seems to be a general issue with IsOnFloor() in the mono build. It doesn't appear to work at all. I was able to replicate this bug with 3.0.4-mono from the website. This bug doesn't seem to affect the is_on_floor() function in gdscript. |
I tinkered around a little bit, re-implementing I might look into doing the same for |
I think this caused by #5910. When building a first person controller, I ran into this exact issue in C#, but I was able to fix it by changing the collision shape of the floor from a PlaneShape to a CubeShape. I downloaded @copygirl 's project and the same change, with a couple tweaks, fixed the issue. The FPS tutorial in GodotScript also breaks if the floor is turned into a plane. It seems that the problem has nothing to do with the C# implementation. I believe this issue should be closed. |
Closing as duplicate of #5910. |
Godot:
3.1.dev.mono.custom_build.896e250
OS: Arch Linux
Issue description
I tried following the FPS tutorial and recreate the 3D movement in a from-scratch project using C# scripts but I quickly ran into the issue of
IsOnFloor()
always returningfalse
no matter what I tried.MoveAndCollide
also never returns a collision even though the entity stops as it collides with the floor.Minimal reproduction project / Steps to reproduce
See the
Player.cs
file of my project.Simply... let the player collide with the ground and see that the printed values stay false.
edit: It was suggested for me to increase the gravity, safe margin and check
IsOnFloor()
afterMoveAndSlide()
, so I did so, but still no luck.edit2: I also tried re-implementing
MoveAndSlide
myself.The text was updated successfully, but these errors were encountered: