janhohenheim / foxtrot

The all-in-one Bevy 3D game template for desktop.
Apache License 2.0
630 stars 45 forks source link

Add autostep for level objects(stairs and low edges) #308

Closed wiktorkujawa closed 6 months ago

wiktorkujawa commented 6 months ago

If you load the level map with autostep, it seems to not work at all. Here's the example I am working on (still WIP too), it has some new models and different dialog interactions, but it's not the case. I have changed the scene level to a more complex one, with many stairs and edges. Here's a wasm example(my example is basing on foxtrot 0.3): https://661ba63c824e4d4afe1f877d--prismatic-shortbread-d520b8.netlify.app/ It would be nice to add a feature for which the character won't stop on a little edge or stairs.

That's the model I used: https://www.turbosquid.com/3d-models/collage-3d-model-2088622

ps. I have also thought, about water physics, but that may be for another thread.

janhohenheim commented 6 months ago

Without having looked too much into it, this seems to be an issue relating to Tnua, the underlying character controller. Have you tried playing around with its parameters?

wiktorkujawa commented 6 months ago

I was using version 0.3 in which rapier was used and tried to use that: https://rapier.rs/docs/user_guides/bevy_plugin/character_controller/#stairs-and-small-obstacles but it didn't work. I thought that may not work because the level model, which I used, was very "monolithic", so it has about 5-6 huge colliders. I tried with different values, but maybe I can check my theory on the "tennis court" collider which is very small.

update: small object theories seem to not work, but I also thought "Autostepping will only activate if the character is touching the floor right before the obstacle. This prevents the player from being teleported on to of a platform while it is in the air." may work, but it seems not working too

janhohenheim commented 6 months ago

Oooh I see! In later versions, I switched away from rapier to XPBD and am now using Tnua instead of a custom character controller. As such, I cannot help you that much. I advise you switch to Tnua as well, since it can also support rapier and supports the mentioned features out of the box.

janhohenheim commented 6 months ago

I'll close this as already done due to Tnua integration, but feel free to reach out to me if you still have questions :)