Hello and welcome!
As you’re getting started I strongly encourage you to take a look at Getting started with Defold Beside this, the problem you are facing is somehow misunderstanding of The building blocks of Defold, but don’t worry, here’s a quick explanation - you do not attach particles to sprites - just to game objects Particles, similarly to sprites, are components:
In your case you added a sprite and particlefx to the same game object, so you only need to adjust the position in the Editor:
(You can play particle effects in the Editor - select the particlefx and click Space to toggle it
)
When you start the game, you can also see a log in the console:
This means, you are also misinterpreting or not used yet messaging in Defold, so take a look here:
And again, here’s a quick explanation - your script and particlefx are in different objects. You could either move the script to the same object or modify your current script to take an absolute path:
particlefx.play("main:/foreground#fire")
Here’s a zip with above corrections:
mobilegamer.zip (7.2 MB)