Use floor normal instead of Vector3::UP
This commit is contained in:
parent
3549cfd351
commit
c530cfedba
@ -114,7 +114,7 @@ impl<T: IPlayer + ICharacterBody3D + WithBaseField> PlayerCommon for T {
|
|||||||
&& let Some(collider) = collision.get_collider()
|
&& let Some(collider) = collision.get_collider()
|
||||||
{
|
{
|
||||||
// Detect if it's floor we're contacting with
|
// 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>() {
|
if let Ok(footstep_box) = collider.try_cast::<FootstepBox>() {
|
||||||
self.set_walk_kind(footstep_box.bind().kind);
|
self.set_walk_kind(footstep_box.bind().kind);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user