godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

Clarify what `CharacterBody2D.floor_block_on_wall` actually does

Open paintsimmon opened this issue 8 months ago • 1 comments

Your Godot version: 4.4.1

Issue description: On the CharacterBody2D page, it says for the floor_block_on_wall property description:

If true, the body will be able to move on the floor only. This option avoids to be able to walk on walls, it will however allow to slide down along them.

However, this doesn't really tell me what the property does. The template script already has a player that will not walk on walls. Setting the property to false doesn't seem to make a difference.

Side note: "to be able to" should be "being able to".

URL to the documentation page (if already existing): https://docs.godotengine.org/en/stable/classes/class_characterbody2d.html

https://docs.godotengine.org/en/stable/classes/class_characterbody3d.html

paintsimmon avatar Apr 07 '25 00:04 paintsimmon

Hello, I'm sorry, I am not sure I am following what is unclear on the documentation. As the comments on the code say, floor_block_on_wall will Avoid [the CharacterBody2D] to move forward on a wall if floor_block_on_wall is true. (basically an equivalent wording than that of the docs). The basic movement script will work as expected- except that with the default parameters, any slope higher than 45 degrees will slide you down with a "large" gravity force. But if you lower the gravity, you will see easily how it will block/unblock you from walking on a large slope (a wall). I don't think the Basic movement was created to show off all features of CharacterBody2d by default, but as a minimal working example.

I think the reference should be unambiguous and concise, however I agree that the tutorial for CharacterBody2d could be expanded to deal with that property, as it is one of the few not mentioned there at the moment: https://docs.godotengine.org/en/latest/tutorials/physics/using_character_body_2d.html#move-and-slide

jynus avatar Jun 02 '25 21:06 jynus