how do you rotate an object around it’s local forward axis regardless of it’s global rotation?
I’m working on a lean mechanic for my fps game, and currently the lean code rotates the player’s character body in the same global direction(east/west) regardless of where you’re facing, so if you’re facing west, it rotates you forward and back instead of left and right.
You need to multiply your rotation vector by the basis to have any meaningful value. Ideally, you also want to separate your model and/or camera Nodes with a “pivot” Node3D that you will be rotating instead of rotating directly the root Node, otherwise it gets messy to synchronize all the rotations together, especially when you want to tween/lerp the values.
that seems like a really great way to do it. for some reason, even multiplying by the basis still isn’t working. I just tried printing the rotation and the basis of the object I’m rotating, and even though it is clearly and visibly rotating, the printed rotation, basis, and global rotation aren’t changing, and it only prints 0,0,0. I don’t understand why
no need! turns out the issue is my lack of comments on my own code! apparently at one point I had added arrow key rotation functionality on top of mouse rotation, (I don’t remember why), and the mouse rotation had no control of the parent’s y rotation value. I really appreciate your help, your solution is the strongest I’ve seen out of any tutorials or anything.