When using takeObject one at a time it shows the animation of moving the card to the zone, but when using it to take all the objects they all move at the same time, even though I added a small timeout after each takeObject.
There are 4 zones to give cards to from all the objects (which right now is just a deck of cards)
This is my test script I have right now.
Code:
function onLoad()
zones = {
c1 = getObjectFromGUID('91eaf0'),
c2 = getObjectFromGUID('d4789f'),
c3 = getObjectFromGUID('a1632b'),
c4 = getObjectFromGUID('f5bfa1'),
}
dealCards()
end
function dealCards()
for _, object in ipairs(getAllObjects()) do
if (object.tag == 'Deck') then
object.shuffle()
for i = 1, object.getQuantity() do
for _, zone in pairs(zones) do
local x = object.takeObject({
position = zone.getPosition(),
rotation = Vector(zone.getRotation().x, zone.getRotation().y, 180),
})
Wait.frames(function()
log(x.resting)
Wait.time(|| x.resting, 0.5)
end, 10)
end
end
end
end
end
I tried just Wait.frames alone, no change, added the Wait.time inside frames, again nothing changed.
I also tried adding the whole takeObject into Wait with the same results.
I'm wondering what am I doing wrong.
Thanks