This is the setup, I have an object in a rotating group to achieve an orbit effect. I would like the object to have a particle trail to follow it. I’ve tried several methods to get the X and Y coordinates of the grouped object in a global manner to which the particles can use to follow. However, since it is in a group, I cannot get them to follow unless they themselves are also inserted into that same group (which I do not want).
This is what I have for particle code so far:
[lua]local myParticles = {}
local myRandom = math.random
local function particleFollower()
for i=1,3 do
local circle = display.newCircle(0,0,1)
circle:setFillColor(myRandom(255),myRandom(255),myRandom(255))
circle.x = myObj.x
circle.y = myObj.y
transition.to(circle,{alpha = 0,time = 500, onComplete = function() circle:removeSelf() circle = nil end })
myObj:toFront()
end
end
Runtime:addEventListener(“enterFrame”,particleFollower)[/lua]
This is general code for it to follow “myObj” when its not inserted into a group, which works fine. However, I need the same “tail” effect when it tracks “myObj” when it’s inserted into a group. , Long story short, the object MUST be in a group for this method of rotation, joints do not work for what we are doing.
Thankful for any suggestions
[import]uid: 40758 topic_id: 22172 reply_id: 322172[/import]