Colision shape of CharacterController doesn't rotate

Hi,



I’m using a CharacterController with a horizontal CapsuleCollisionShape too control a dinosaur, but when I rotate it using setLookDirection(), it only rotates the spatial, and not the collision shape (=capsule)(Tested by using debug graphics). I found no other way too rotate the controller. What should I do?

1 Like

Cope with it. It just doesn’t rotate.

Hello,

I know this topic is very old. But maybe there is a possibility to rotate the collision shape after all these years? For upright standing and moving objects I think there is no need for rotation. But for long objects or vehicles I think it is a little bit problematic, if they can not rotate their collision shape.

1 Like

The CharacterController class was apparently renamed to CharacterControl sometime in the past 10 years. It’s based on the btKinematicCharacterController class in Bullet Physics, which supports sliding motion but not turning motion.

For vehicles, you should of course use VehicleControl instead of CharacterControl.

For a character that is elongated in a horizontal direction, such as a snake, you could use a collision shape that is larger than the model, so that the model fits inside the shape no matter which direction it is facing. That would of course constrain the character’s motion more than necessary.

Another possibility would be to write a custom physics control for your character. If you take that route, I suggest using BetterCharacterControl as a starting point, since it is based on a rigid body, not btKinematicCharacterController.

1 Like

Thank you for the answer. I will look up these things and try a little bit.

1 Like