How to rotate character with irregular collision shape?

Godot Version



I’m starting and I can’t find a proper solution for rotating collision shapes of characters with irregular shape.

In Godot 3D tutorial you create characters as CharacterBody3D with Pivot child containing the mesh and CollisionShape child. Then on movement, you rotate the Pivot, not the whole CharacterBody3D.

I understand you don’t rotate the whole CharacterBody3D because this would affect velocity. It’s better to keep the reference coordinates unchanged and only rotate the model.

But what about the CollisionShape rotation?

What if the model shape is irregular, requiring irregular CollisionShape? Like in here:

  1. Do you have to use CollisionPolygon?
  2. I know you can use “Create Trimesh Collision Sibling” - can you somehow group meshes to create a single Collision Sibling? Or you create 2 separate CollisionShapes?
  3. When you rotate the Pivot in code, do you just rotate the CollisionShape too (setting CollisionShape rotation same as Pivot rotation)? Or is there a “smarter” way of doing it? Use RemoteTransform? But for it to work, the CollisionShape must be a single node with rotation point in (0,0,0), just like the Pivot.

I hope you understand my confusion.

Have the collision shape act as the pivot maybe?

Or just sync those two every frame, that shouldn’t be a big deal.