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

BodyPosition doesn't work when trying to move part?

I have a game, where there is a wave, I am trying to get the wave to move using body position, but it doesn't work. All that happens is, the wave falls because it's not anchored.

My script:

local Part = script.Parent
local newPos = Part.Position + Vector3.new(1500,0,0)
local Time = 10
local Increment = 0.5
local startWave = workspace:WaitForChild('startWave')
local Diff = newPos - Part.Position
local Mag = Diff.magnitude
 
function MovePart()
    script.Parent.BodyPosition.Position = Vector3.new(newPos)
    wait( (Time/Mag) * Increment )
end

startWave.Changed:Connect(MovePart)

My hierarchy, and my BodyPosition properties

Any help is appreciated, thanks. (There are no errors in console)

2 comments

1

Vector3.new(Vector3.new()). Great

0

I've changed it , but it still just falls.

1 answer

✓ Accepted answer

Chances are that using a BodyForce for your object won't be sufficient without a greater force, try increasing the MaxForce by quite a substantial amount and see if that solves your problem.

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