Unable to find an object via its URL with script

Since starting i have nothing but problems with an objects URL ill play with it move it and usually I finally get the script to locate the object. But I would like to understand what it is im not getting ive read anything I can find about them which isnt much. But here is my current example :


Nothing I do and no matter how I put in the URL , my coin.script cannot find the coin.particlefx

1 Like

You are confusing the folder structure with actual structure of your scene graph. You can have your files arranged any way you like. What matters is how the different scripts, particle fx, game objects and collections are organised in the Outline when you open a collection or game object.

So, if you have a coin.go and you have attached a sprite, script (coin.script) and particle fx component then this is how you’s play the patrticle fx from coin.script:

particlefx.play("#particlefx") -- assuming that you named the particle fx component particlefx.
5 Likes

Thank you that was very helpful and explains a lot.

1 Like

There’s a brand new manual on message passing that I hope explains all this better than the old one: http://www.defold.com/manuals/message-passing/

6 Likes

Brilliant manual @sicher! Hopefully this will make the concept of message passing easier to grasp for new users!.

2 Likes