So, I was trying to lock the X and Y axis and let the Z axis freely rotate (Basically like a 2d effect)but completely failed to. This feature can also be seen in a popular sandbox game called “people playground” and many other 2d games.
There is a significant different between 2d games and Roblox, for starters, Roblox is 3d. What this practically means is that the rotation effects on those games work fundamentally different from 3d games.
However, this does not mean that you can’t do it in Roblox. There are different ways to achieve this, however I’m not sure which would be the best solution.
First alternative:
Reset the orientation on the X & Y axis as soon as it’s rotation changes. I think this will be fairly resource intensive.
Second alternative:
Figure out a way to use AlignOrientation (roblox.com) to your advantage. It’s the new BodyGyro if you are familiar with that.
Third alternative:
Anchor all parts and let your own scripts decide when they should rotate, and only allow them to rotate on the Z axis.
I have not yet tried using AlignOrientation, I would recommend that you play around with a singular part which uses it and then tweak them until you find what you are looking for.
There is no guarantee this would work though, but one can always hope.