I want to make a hovering block. I want to lock the Y position, while able to move it (change the X and Z position.) Is there a way to fix this?
COMMUNITY QUESTION
Is there a way to lock Y position?
2 answers
If it's anchored, just script it carefully or constanttly reset its y pos to zero.
otherwise you can insert a bodyForce to counteract gravity.
part.BodyForce.force = Vector3.new(0, game.Workspace.Gravity, 0) * part:GetMass()
Additionally you can loop: wait until its position is not y, then continuously decrease its velocity until low, then briefly insert a bodyposition.
Have a "BodyVelocity" in the part and set the Y value in "Velocity" to whatever height you want.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Body Velocities make the velocity of the part or model they are in equal to whatever the "Velocity" value is. If OP does what you said, the "hovering block" would actually move straight upwards at a speed equal to the Height he put in the Y value.