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

Tween Service Moving Multiple Parts?

Asked by 2 years ago

I have made this script but every time I start the game, the objects are clumping together, they make a single part.

-- Services
local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService('ReplicatedStorage')

local Parts = game.Workspace.Parts
local MovePart = Parts.Move
local partBabys = Parts:GetChildren()
local point = ReplicatedStorage:WaitForChild("Point").Value

for i,v in ipairs(partBabys) do
    if v:IsA('Model') then
        local MoveProperties = {
            Position = Vector3.new(point, v.PrimaryPart.Position.X, v.PrimaryPart.Position.Y, v.PrimaryPart.Position.Z)
        }

        local MoveInfo = TweenInfo.new(17, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, -1, false, 0)

        local MoveTween = TweenService:Create(v.PrimaryPart, MoveInfo, MoveProperties)

        MoveTween:Play()
    end
    if v:IsA('Part') then
        local MoveProperties = {
            Position = Vector3.new(point, v.Position.Y, v.Position.Z)
        }

        local MoveInfo = TweenInfo.new(17, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, -1, false, 0)

        local MoveTween = TweenService:Create(v, MoveInfo, MoveProperties)

        MoveTween:Play()
    end
end

1 answer

Log in to vote
0
Answered by 2 years ago

Instead of making position where to go change the position of part so it will move off itsself

Ad

Answer this question