ios - Making a particle follow a path in spriteKit -


i have created particle , when test moving on xcode's property window, looks this:

enter image description here

i have added particle scene, made circle , forced particle run circle using this:

    nsstring *myparticlepath = [[nsbundle mainbundle] pathforresource:@"particle" oftype:@"sks"];     skemitternode *myparticle = [nskeyedunarchiver unarchiveobjectwithfile:myparticlepath];     [self addchild:myparticle];      cgpathref circle = cgpathcreatewithellipseinrect(cgrectmake(0,0,400,400), null);      skaction *followtrack = [skaction followpath:circle asoffset:no orienttopath:yes duration:1.0];      skaction *forever = [skaction repeatactionforever:followtrack];      [myparticle runaction:forever]; 

this how looks like. block of white sugar candy. node particle following path, not generated particles.

i have represented circle in dashed can see path following...

enter image description here

any ideas?

thanks

you sent particle emitter follow path. if want individual particles run action, use emitter's particleaction property:

myparticle.particleaction = forever; 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -