Rotating an AnimatableBody3D

Godot Version 4.3

Question

Hello,

I’m making a 3D game where the player, which is a CharacterBody3D, can stand on moving and rotating platforms. The player must be moved with the platform when the platform is moved. Same for rotation.

I asume that I must use the AnimatableBody3D for the platforms. But when I look in the docs I cannot find a function to rotate the AnimatableBody3D. There is a motion vector in the move_and_collide() function. But no rotation vector.

I can ofcourse rotate the AnimatableBody3D by changing the rotation property directly but I assume this will not rotate the player when he’s standing on the platform. Or am I wrong?

How do I properly do this?

Try it out, AnimatableBody is supposed to work by detecting a transform change each frame and converting it into a physical forces. Though it does have some bugs when changing multiple properties per-frame (or at least through a AnimationPlayer), so if you need both position and rotation you could edit the transform to get around that.

Thanks, I will try it out.

I have good news and bad news.

The good news is that it works for the position.

The bad news is that it does not work for the rotation.