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

BodyPosition doesn't work when trying to move part?

Asked by
awfulszn 394 Moderation Voter
6 years ago
Edited 6 years ago

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)

1
Vector3.new(Vector3.new()). Great hiimgoodpack 2009 — 6y
0
I've changed it , but it still just falls. awfulszn 394 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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.

Ad

Answer this question