Hi,
Am using StoryBoard and need to add a timer.performWithDelay, at the moment I have it in EnterScene but it only runs once. I need it to loop forever.
My exact code is -
aiTimer = timer.performWithDelay( 1000, aiPlayer(), 0 )
Any ideas where I should put it in my code ?
Dave [import]uid: 117617 topic_id: 28237 reply_id: 328237[/import]
That timer will loop forever, because your last argument is set to 0 - loop forever.
You’ll probably need to remove the parenthesis on the function call however.
aiTimer = timer.performWithDelay( 1000, aiPlayer, 0 )
[import]uid: 33275 topic_id: 28237 reply_id: 114065[/import]
Thanks, that was the problem. Removed the parenthesis and its now looping.
Cheers,
Dave [import]uid: 117617 topic_id: 28237 reply_id: 114069[/import]