Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I can't seem to get a moving wall to stop moving when it hits a position?

Trying to make a moving wall with bodyvelocity that stops at a certain position

x = game.workspace.Wall

if x.Position==Vector3.new==245.5, 134, 0 then x.BodyVelocity.Velocity=Vector3.new==0 end

1 comment

0

please put it in a code block

1 answer

You have some mistakes here, quite major ones. First off, Vector3.new is a built-in function, and because it's a function it needs parenthesis instead of equals.

Your code but fixed:

local x = game.Workspace.Wall -- making it local will increase performance

if x.Position == Vector3.new(245.5, 134, 0) then
	x.BodyVelocity.Velocity = Vector3.new(0, 0, 0)
end

1 comment

0

this doesnt give errors but it still doesn't seem to be working.

This discussion is preserved as it was. New answers, comments, and votes are closed.