Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i lock a part's Z position?

Asked by 4 years ago

https://gyazo.com/4a2ccdc7d78d422743adca3f0b6e1a72 in that gif, the cube lands fine, but sometimes it falls off the map, how do I lock/anchor it's current Z position without anchoring it whole?

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

You can make it so the z position always stays at the specified value with the following code:

z = 50
part.Position = Vector3.new(part.Position.X,part.Position.Y,z) --assuming you already have a variable for the part
Ad

Answer this question