How to make sure an object only moves on a single axis

I’m trying to make an object only move on the X-axis and am pretty lost. Is there any object or method to do this?

1 Like

You could make a script that sets the objects Y and Z axes to the values needed.

Do you have a method that restricts y/z axis movement instead of setting the CFrame every frame individually? What I’m doing involves player movement so it would take up tons of resources to set the CFrame every frame

You could anchor the part then move it on the X axis.

Yes, but as this has to do with player movement, I’d have to be moving it every frame which is inefficient, is there anything kind of like an AlignOrientation that would make sure that the HumanoidRootPart stays on the right y/z axis without needing a script to update it every frame

I’ve check and I don’t think so. But there are the BodyPositon and BodyVelocity objects that you could use and see how to lock the player on the Y and Z axis.

I tried that, but had more luck using a PlaneConstraint instead. Thanks for your time and your help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.