-
What do you want to achieve? I am currently working on a game that will feature a system where players can pick up, carry and throw certain objects (which for the sake of this post I will refer to as “grabbables”). For many reasons, such as stylisation and ease of use in puzzles/platforming, I want to limit the rotation of these grabbables to one axis.
-
What is the issue? I have been unable to find a way to limit the rotation of the grabbables despite my best efforts.
-
What solutions have you tried so far?
- Updating the part’s CFrame every frame to set its RX and RZ to 0. This works well except for when the object interacts with slopes, which this game will feature a lot of.
- Using a combination of AlignOrientations to limit the rotation to one axis. This almost works perfectly but it has the added side effect of causing the freely rotating axis to always attempt to pivot towards a resting point.
- Using a HingeConstraint. This locks the part’s position in place.