Hey guys, I was curious if there was a way to lock the a parts movement on just one axis. I know you can can use prismatic constraints to do that somewhat, but what if you wanted to lock it only on one. For instance, what if you want a part to be movable on the X and Z axis, but locked on the Y? I don’t care if it’s done by using script, or a constraint of some sort, I just want to know if it’s possible.
Most definitely possible. You can try using CFrame, Vector3 or even BodyMovers as @ShadokuSan as said.
--CFrame
PartNameHere.CFrame = CFrame.new(10, PartNameHere.CFrame.p.Y, 10) -- or replace Y with 0, but usually ill advised
--Vector3
PartNameHere.Position = Vector3.new(10, PartNameHere.Position.Y, 10)
I suggest using CFrame over normal position because only using position has its fair share of problems, plus CFrame can do what position does but with more features.