Hello! I am working on an item-pickup system and I tween all parts of an item (its is a wood block with some branches, so its a model with a primarypart) but when I tween them the game waits for the first part to tween and only then tweens to the second, then waits again and tween the third, etc… How do I tween all of the parts at the same time?
code:
pickupItem.OnServerEvent:Connect(function(player, item)
local character = player.Character
local inventory = player.Inventory
if item then
print("found item")
local itemValue = inventory:FindFirstChild(item.Name)
if itemValue then
print("item is in folder")
itemValue.Value = itemValue.Value + 1
local finishingLocation = character.HumanoidRootPart.CFrame
local propertiesToTween = {Transparency = 1, Size = Vector3.new(0,0,0), CFrame = finishingLocation}
for i, part in pairs(item:GetDescendants()) do
if part:IsA("BasePart") then
part.CanCollide = false
part.Anchored = true
local tween = TweenService:Create(part, pickupTweenInfo, propertiesToTween)
tween:Play()
wait(0.3)
print("finished tweening "..part.Name..", which is a descendant of "..item.Name)
end
end
item:Destroy()
end
end
end)