Hey Defold people! I’m very new to Defold, although I’ve developed reasonably successful IOS and Android apps on the Gideros platform. Now looking for a new environment I’m going through Defold docs and tutorials and this seems to be a nice one to continue to develop in.
But there seems to be a knot that needs to be untied. I can’t get if there is something fundamental that I have missed in the organisation of objects and components or if there is something else.
I wanted to create an sprite using factory.create() in a script (although now I have stripped the project from everything unnessecary). I’m calling the factory instance within a game object, but I get this:
no instance could be found in the current script environment
Out of docs and tutorials I understand #factory (or /go#factory) refers to the factory called “factory” in the “go” game object, but I’m clearly missing something here.
No, those two lines were the only ones in the script. So, now as I understand it - although some code obviously works outside the predefined callback functions (init(), update() etc), some other doesn’t - like callling and communicating with other parts of the project. So it is highly recommended to stay within the functions, right? If so, that might be the untied knot. Moving on!
Thanks! I really like how one can put different pieces together in Defold, and not least the extensive documentation and reference library with examples.