ios - SKAction runblock with arguments -


i have been trying implement following functionality in game. run action on sprite node (sprite node parent nil) , action should wait specified time , add node self. not find action adds node parent. thought doing that:

node.runaction(skaction.sequence([skaction.waitforduration(timetowait), skaction.runblock(addtoself(node))])) 

and having method this:

func addtoself(node: skspritenode){     self.addchild(node) } 

if succeed doing this, game performance improve lot. knows there work around?

you on right track. should able use

skaction.runblock({ self.somefunction(param) }) 

see documentation more details.


Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -