How do I make old created objects by event not follow future events for new created objects.
When I click, the fire ball follows the cursor and shoots out when released. And when I click again a new fireball is created to follow the cursor while the old fireball continues to shoot out.
But instead, whenever i click, both of them follows the cursor so the fireballs keeps stacking unless they are deleted.
Your second to last event is causing your issues.
- Only actions that are in the same event as the create action will target that newly created instance. Since your tween event is separate from the create event, it is targeting all instances
- Tweens must have a trigger once condition to function correctly. Otherwise every frame the conditions are true it will restart the tween.
I would move the tween action out of that separate event and put it immediately under your create action in the event above it.
For your separate “mouse released” event at the bottom, you are going to have to rework the event entirely. You will need to store the “destination x/y” as object instance variables immediately upon creation, then have the move action target those object variables instead of the cursor directly.