i am new to Defold and lua. So a big Hello an a big Thank You for giving us your Engine for free and on top supporting us. Also hello and thank you to the all the other Devs around here for your support.
ERROR:GAMEOBJECT: Properties can not be of type 'nil'.
ERROR:SCRIPT: animals/animals.script:9: the property 'image' of '#animalSprite' must be a number
stack traceback:
[C]:-1: in function set
animals/animals.script:9: in function <animals/animals.script:5>
what am i doing wrong? If i put the path directly in the resource.atlas("") all is fine. Also hash(path) produces the same error.
It seems not be only the concatination. When you put a variable in the resource.atlas() instead of a string directly it did not get the string from the variable. Is there something i don’t understand right in lua or defold or is this a bug?
Your second post started to ring some bells for me. I think it might be related to this:
TL;DR: loading can not be done dynamically, Defold automatically scans for string paths when building/bundling.
I wonder if we could confirm this is the case by first doing a dummy load using a hardcoded string, and then do it again using a variable? If my theory is correct then that should work. You’ll need to redesign if so, but at least you’ll know “why”.