How do I make sure a BodyVelocity doesn't go past a point

I’m making a tornado script and I would like to know how I make it not go past an area and stays in the town.
Movement code

local bv = script.Parent.Move

while true do
wait(math.random(2, 3))
bv.velocity = Vector3.new(math.random(-150, 150), 0, math.random(-150, 150))
end
1 Like

I would use rocket propulsions even then I dont like working with body movers very much. I suggest you use a anchored part and either tween it, or repeatedly move it with a .stepped. Just more reliable that way.

If I were to tween it how would I keep it in bounds still.

Create a part in workspace that is the allowed area of the tornado and use this script. Deinfe “part” first.

PosX = math.clamp(part.Position.X, bounds.Position.X - bounds.Size.X/2, bounds.Position.X + bounds.Size.X/2)

part.Position = Vector3.new(posX, posY, posZ)