0
\$\begingroup\$

In a CharacterController object, there is

setMaxSlope(btScalar slopeRadians)  
The max slope determines the maximum angle that the controller can walk up.

But how about knowing it in advance? Like check if the position where the character will move next is walkable (i don't know the correct word) or not? Is that possible? Any suggestions on how should I go about this?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

You could sense ahead of your characters movement with a ray-cast or a bunch of ray-casts depending on your desired accuracy. Then calculate the slope angle in front of your character by using the polygon's slope directly or in case of multiple ray-casts, calculate some approximation.

I did this when I first started out with a Kinematic Controller. But eventually, the controller had too many shortcomings and I implemented my own as I describe here:

https://stackoverflow.com/questions/25605659/avoid-ground-collision-with-bullet/25725502#25725502

\$\endgroup\$

You must log in to answer this question.