godotengine / godotengine/godot-docs

Collision state of `CharacterBody3D` is also updated when calling `CharacterBody3D#apply_floor_snap()`

Open
#10,636 0 comments 0 reactions 0 assignees View on GitHub
area:class reference topic:physics
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:**
4.4.beta
**Issue description:**
As the title says, the return value of all `is_on_*()` methods might change when running `apply_floor_snap()`, but the documentation says it only changes when calling `move_and_slide()`. This is because the method that updates the state ([_set_collision_direction()](https://github.com/godotengine/godot/blob/3f56b3b23916ff54a1715cb8444304ce3c50283d/scene/3d/physics/character_body_3d.cpp#L521)) is also called inside of `apply_floor_snap()`. Not sure if all values *realistically* can change, perhaps, only `is_on_floor()` can, but I'd include them regardless since `_set_collision_detection()` can definitely change them. The documentation of all the `is_on_*()` methods should be updated to include that extra information.

The same goes for `CharacterBody2D`.

**URL to the documentation page:**
https://docs.godotengine.org/en/stable/classes/class_characterbody3d.html#class-characterbody3d-method-is-on-floor and all the other `is_on_*()` methods in `CharacterBody3D`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.