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

How do i make moving part positioning work in-game?

Asked by 5 years ago

I made a script to make a certain part move at a speed. The part is anchored and non-colliding. However, when i play the game, the part moves horizontally, but bumps really much up and down and when it encounters another part, it goes up so it doesn't touch that other part. I just want the part to keep going through the terrain and other parts... How do i make sure the collision-problem is gone in my script/game?

local Bottom = script.Parent
local StartPosition = Vector3.new(-0.425, -12.332, 991.53)
for i = 1,1000 do
    wait(.01)
    Bottom.Position = StartPosition + Vector3.new(0,0,i*-5)
end
0
can.collide is set to false ? mixgingengerina10 223 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Rather than setting the Part's Position try setting its CFrame instead.

local Bottom = script.Parent
local StartPosition = Vector3.new(-0.425, -12.332, 991.53)
for i = 1,1000 do
    wait(.01)
    Bottom.CFrame = CFrame.new(StartPosition) + Vector3.new(0,0,i*-5)
end
Ad

Answer this question