I’m working on a character controller and I noticed my character getting stuck to walls in very specific conditions, in both in Jolt and Godot Physics. As I was messing around trying to figure out what could be causing this I stopped rotating the CharacterBody3D and magically the problem stopped happening.
I can intuitively understand why rotating a character body might cause issues, as setting the rotation or position of a rigid body directly would be problematic as well, but since the docs don’t mention it I decided to ask here.
It really depends on what you’re trying to accomplish, but rotating the whole body, including it’s collider is generally not the best idea as physics will be affected by it.
If all you need to do is rotate your character model, you can do that, even better you can add some sort of node to serve as the root of all the visual parts of the character and attach them to that root node, then use that for rotation. If physics need to be involved in this then it’s a different story though.
If you want help with this, you need to give us more info. Show us a screen shot of your scene tree, the 3D model with collision shapes enabled, and the code you are using for rotation.
You can rotate anything. Your collision issues do not have anything to do with what node you are rotating.
Not looking for help with my code specifically. I’m just asking if rotating a character body can cause the same issues as rotating a rigid body through the “rotation” property, and it seems like it can. Thanks for the answers!
Character body is meant to be transformed via script. So any “issues” you might have are likely not caused merely by rotating. Any unwanted collision resolution behavior that you may characterize as “issue” will depend on the context; your setup, colliders, code… Technically, there are no issues with rotating it. So yeah, it is “allowed”.
All I’m doing is setting the character’s velocity and calling move_and_slide. In one case the body rotates around the Y axis to follow a moving target, and in the other case it doesn’t rotate. So it does feel like rotation is what is causing the issue, even if it’s specific to how move_and_slide resolves collisions.