onCompleteParams ?

Hello!

I got a simple transition:

[lua]transition.to(spiderGroup, {time = 6000, x = leftMargin, onComplete = enemy.resetMe, onCompleteParams = spiderGroup})[/lua]

and on my enemy.lua I got the resetMe function:

[lua]function resetMe(params)
params.x = 300
end[/lua]

Everything working fine, however I would like to send multiple parameters to that resetMe function, for example the 300 value but I didn’t managed to do that. How does that work?

Thank you :slight_smile: [import]uid: 125690 topic_id: 23323 reply_id: 323323[/import]

[lua]transition.to(spiderGroup, {time = 6000, x = leftMargin, onComplete =
function(params)
params.onCompleteParams = spiderGroup
enemy.resetMe(params)
end})[/lua] [import]uid: 64174 topic_id: 23323 reply_id: 93441[/import]

This is the only way to do it?

Can’t I just pass a table on the onCompleteParams ? Like this?

[lua]transition.to(spiderGroup, {time = 6000, x = leftMargin, onComplete = enemy.resetMe, onCompleteParams = {spiderGroup, 300}})[/lua]

but then the question is how would I access it on the enemy.lua? I tried

[lua]function resetMe(params)
params[1].x = params[2]
end[/lua]

but this does not work. by accessing params[1] should not get me the first table element and param[2] should not get me the 300 value?

thank you! [import]uid: 125690 topic_id: 23323 reply_id: 93482[/import]