Anchor on only single axis?

I want a model to only move on the X and Z axis but not move on the Y axis at all. (Not be able to move up or down) Is there a way to do this? Also, I have the same question except anchoring a model/part on a single rotational axis so it can only spin on one axis. (Like if you wanted to make a spinning top)

1 Like

Building wise, this cannot be done as far as I know. Is there a reason why you want to do this?

I need something that can move on the X and Z axis without going up or down even if something pushes it up or down

The best solution that comes off of the top of my head is using a script for that.

You can use Constraints for these. The single rotational axis you will want to use a Hinge Constraint with actuator set to Motor:

https://developer.roblox.com/en-us/api-reference/class/HingeConstraint

For the one moving on X and Z axis you will want to use AlignPosition I believe, with its property mode set to OneAttachment, then choose the position among the two axis you want:

https://developer.roblox.com/en-us/api-reference/class/AlignPosition

1 Like
local part = -- Path to your part/union/mesh

local YPos = part.Position.Y -- Default Y Position

part.Changed:Connect(function() -- Update
part.Position = Vector3.new(part.Position.X,YPos,part.Position.Z) -- Sets the Y position to the default
end)
1 Like

You could try a ceiling block and use collision groups so players don’t collide with it.

You can do these by scripting or hinges I think. It’s not the best category for this topic.

1 Like

just use a plane constraint, it just exactly what you want