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

[Solved] How to make a brick stop at a certain Position with BodyPosition?

Asked by 5 years ago
Edited 5 years ago

So I have a block set to move to other block positions/rotations. But when I run my script, the block (that is moving) goes past the designated area to stop (I'm all good with rotations). All the areas for it to stop is called "mid#". How do I make it so that the "platform" (the moving block) stops at mid# without going past it? I think it's something to do with maxForce Vector3 but I want my "platform" to move slow.

local model = game.workspace.MovingPlatformModel
local platform = model.Platform
local start = model.BlockStart
local mid1 = model.BlockMid1
local mid2 = model.BlockMid2
local mid3 = model.BlockMid3
local mid4 = model.BlockMid4
local mid5 = model.BlockMid5
local mid6 = model.BlockMid6
local mid7 = model.BlockMid7
local finish = model.BlockFinish
local bodyPosition = platform.BodyPosition

--Loop is while true do (ignore this)

bodyPosition.position = start.Position
bodyPosition.maxForce = Vector3.new(75,2000,75)
    wait(3)
bodyPosition.position = mid1.Position
platform.Orientation = Vector3.new(0,0,0)
    wait(10)
bodyPosition.position = mid2.Position
platform.Orientation = Vector3.new(0,45,0)
    wait(10)
bodyPosition.position = mid3.Position
platform.Orientation = Vector3.new(0,90,0)
    wait(10)
bodyPosition.position = mid4.Position
platform.Orientation = Vector3.new(0,135,0)
    wait(10)
bodyPosition.position = mid5.Position
platform.Orientation = Vector3.new(0,85,0)
    wait(10)
bodyPosition.position = mid6.Position
platform.Orientation = Vector3.new(0,45,0)
    wait(10)
bodyPosition.position = mid7.Position
platform.Orientation = Vector3.new(0,-5,0)
    wait(10)
bodyPosition.position = finish.Position
platform.Orientation = Vector3.new(0,-45,0)

1 answer

Log in to vote
0
Answered by 5 years ago

Ok, I found the Solution, I use BodyVelocity instead of BodyPosition!

Ad

Answer this question