Hi everyone. I was wondering how to make a fixed axis dragging system for my placement system. While the x and z axis dragging is going well, I am having trouble fixing it to the y axis. Any fixes to this?
if Axis == "All" then
Target.Position = Mouse.Hit.Position + Vector3.new(0,Target.Size.Y/2,0)
elseif Axis == "X" then
Target.Position = Vector3.new(Mouse.Hit.Position.X, Target.Position.Y, Target.Position.Z)
elseif Axis == "Y" then
Target.Position = Vector3.new(Target.Position.X, Mouse.Hit.p.Y, Target.Position.Z)
elseif Axis == "Z" then
Target.Position = Vector3.new(Target.Position.X, Target.Position.Y, Mouse.Hit.Position.Z)
end
If you have a part on the same X & Z coordinates as you wish to lock it on, then the mouse would hit this part’s surface. If it hits this surface you will be able to get an accurate Y value. Making it transparent is only to hide it from the user, figured you might’ve wanted it hidden.