Hi there. I’m trying to figure out a way to move a model/part in a way where it’s only affected on the Z axis. The reason why this is so important is because I’m building a script which keeps a part at -11 studs on the Z axis, but it should move freely on the X and Y axis to whatever physics are applied to it. In this script, it adjusts the position every RenderStepped. It keeps the part on the Z axis at -11 studs, but now the problem is that the part won’t move on the X or Y axis because the current script is constantly keeping it in the same place because even though the X and Y values are set to whatever position the object is already in, it adjusts the position of the object every RenderStepped, so before the object can react to the world’s physics it just constantly gets readjusted to that position, making the object immobile. Below is the script.
game:GetService("RunService").RenderStepped:Connect(function()
game.Workspace.Model:MoveTo(Vector3.new(game.Workspace.Model.Part.Position.X, game.Workspace.Model.Part.Position.Y, -11))
end)
I ask for help from anyone to solve this issue with me. Thank you.