I’m new and I’m still not sure how rotations work. I know the solution to my problem probably has to do with localRotation, but I’m lost.
What I want to do is to make an object that rotates in its own X axis based on the mouse X, while inside a parent that rotates in its own Y axis, based on the mouse Y. All of that inside a box rigidbody that is free to rotate in all kinds of ways, with all the rotations “adding” (that is, not ignoring the parent’s rotation). Would also be good to clamp the child’s X at 90°/-90° and its parent’s Y at 180°/-180°.
If it helps, this is a solution I came up with for my camera, since I noticed the scripts sometimes do some weird rotations. I started thinking mechanically and how a robot would do it, as well as how our necks do it, and that was the solution I came up with. So, naturally, if there is a better or simpler way of getting this desired mechanical first person effect, that would be great.
Any help is massively appreciated.