#I don't know how to make the controller "bevy_tnua" walk on an inclined plane.

10 messages · Page 1 of 1 (latest)

slate delta
#

I created a "bevy_tnua" controller to control the character based on "", but when I try to climb up an inclined surface my character gets stuck and that's it. I create character control like in 3D shooters.
Physics engine: Avian3d

Controll:
for walk - W, A, S, D
for run - Shift
for crouch - Ctrl
for look around - Mouse

Source: "https://github.com/jdose100/The-nightmarish-forest-game"
Files affecting player control: "https://github.com/jdose100/The-nightmarish-forest-game/blob/main/src/player/character_controller.rs" and "https://github.com/jdose100/The-nightmarish-forest-game/blob/main/src/player/mod.rs"

I'm new to Rust and Bevy, so please don't hate my code too much. But I would like you to point out not so Rust Friendly situations and bad architectural decisions (this is only optional).
And excuse my English, it's not my native language

scenic creek
#

I tried to run your game and noticed something strange:

#

It looks like it can float on one triangle of the slope - but not on the other.

#

Like the raycast doesn't detect it.

#

Maybe it's inverse?

#

Actually. No. It's about the height in the slope, not about which triangle you're on.

#

At any rate, I'm not sure why, but adding a TnuaAvian3dSensorShape (to the character entity itself, not to the crouch enforcer sensor) fixes the problem.

#

Without it... something goes seriously off with the raycast. It's like completely misses the mesh in some cases. But this may be more of an Avian issue.

raven forge
#

i've been having a minor issue where the detected floor can be the lower object in a case like this, and the best way to fix it for me was to just make the capsule a little smaller and higher up (though it doesn't happen anywhere near as much with a sensor shape)