How do I move only the Y access in a script
Part.Position = Vector3.new(Part.Position.X,NewPosition,Part.Position.Z)
so I just put this into a script?
Here, let’s make a function to change the part’s Y position!
local function changeY(part,new_y)
local oldPos = part.Position
part.Position = Vector3.new(oldPos.X,new_y,oldPos.Z)
end
Basically this function takes a part and number (y position) and it saves the old position to a variable “oldPos” and it makes a new Vector3 (use for positioning) with the old X, old Z, but the new Y instead and sets the part’s position to this Vector3!
Enjoy and make sure to make as solution if this helps! ![]()
ok thank you
![]()