About methods in move_and_slide

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lalel345

if the kinematic player is move_and_slide in floor I must call get_floor_normal method??

If you don’t know, a vector normal represents the direction perpendicular to a surface ⊥.

Magso | 2020-10-14 14:21

:bust_in_silhouette: Reply From: jgodfrey

There’s no reason that you must call get_floor_normal. If you’ve called move_and_slide() and you’re currently on the floor (so, is_on_floor returns true) you can call get_floor_normal if you the information it returns if helpful to you. But, again, there’s no requirement that it be called.

but then never use this?if for example there is a jump and it returns to the floor,it is necessary to call it

lalel345 | 2020-10-13 21:21

Again, it’s never necessary to call it - Godot doesn’t care. It’s just provides information to you, the programmer, about the normal vector of the colliding floor (assuming there is one). If that info is useful to you, you can call it and use it. If it’s not, you don’t have to. Godot does not require you to to call it…

jgodfrey | 2020-10-14 13:52