Use floor normal instead of Vector3::UP

This commit is contained in:
Sofia 2026-08-07 22:09:46 +03:00
parent 3549cfd351
commit c530cfedba

View File

@ -114,7 +114,7 @@ impl<T: IPlayer + ICharacterBody3D + WithBaseField> PlayerCommon for T {
&& let Some(collider) = collision.get_collider()
{
// Detect if it's floor we're contacting with
if collision.get_normal().dot(Vector3::UP) > 0.95 {
if collision.get_normal().dot(self.base().get_floor_normal()) > 0.95 {
if let Ok(footstep_box) = collider.try_cast::<FootstepBox>() {
self.set_walk_kind(footstep_box.bind().kind);
} else {