Godot Is On Floor Doesn T Work
A community for discussion and support in development with the godot game engine.
Godot is on floor doesn t work. Create a uneven mesh. Windows 10 gtx 1080 issue description. Kinematicbody2d isonfloor is intermittently false when moving against the floor normal steps to reproduce. This is not how is on floor works.
It also flickers if you outright don t move towards the floor at all while on the floor because we re moving 0 pixels down then 20 down then 0 then 20 etc. The value of is on floor is set by move and slide since you re using the previous frame s value and then moving with no gravity the value is being set to false. I have checked the remaining vector after the reset and it s 0 1 666667 with false floor flag. This is a common misunderstanding.
Move and slide motion floor normal the last parameter is important too if you want to allow some specific angles to be taken as floor like on slopes or. Give the mesh a trimesh collision. In order for is on floor to detect the floor collision the kinematic body must keep falling in order to fix your problem you can just add a small value to the initial move and slide. The is colliding function doesn t return whether or not the kinematicbody2d is currently colliding with something it merely returns whether the last call to move was able to move all the way.
Press j to jump to the feed. For some reason when the speed y is reset to 0 the isonfloor function stops working properly. The method move and slide have a couple of parameters the 2nd one is the floor normal if you set it like 0 1 0 pointing up on y then when checking it should say true if is the close to the normal including slope tolerance. 3 0 c with mono os device including version.
And another thing the is on floor and other functions derived from move and slide work only after you use the move and slide for that specific frame for example if you will replace the move and collide with. Then it s 0 3 333333 for the next frame again with false floor flag in the third frame it s 0 0 with the floor flag set to true. Press question mark to learn the rest of the keyboard shortcuts. Kinematicbody2d s is on floor seems to flicker in the example when moving towards the floor if you re moving towards it at very low speeds.