I am currently working on a simple 2D tower defence type of game and today added a Main menu to the game by making a new main.collection with the menu, and switching to a game collection after a button press, using collection proxies and it works great. However, when I now switch to the game collection, my “hero” freezes while trying to update my mouse position. I am using my cursor to aim. I never altered the hero script at all while working on the main menu and has been working flawlessly until now. I am guessing it has a hard time with the new collection or something? See screenshot of the code. What do you smart people think is the problem? Do not hesitate to let me know if you need more information.
This is my error message:
“ERROR:SCRIPT: HelloLibrary/Scripts/Topdown/Hero.script:72: bad argument #1 to ‘__sub’ (vector3 expected, got nil)
stack traceback:
[C]: in function ‘__sub’
HelloLibrary/Scripts/Topdown/Hero.script:72: in function <HelloLibrary/Scripts/Topdown/Hero.script:59>”
After doing some more digging I found out that I needed to acquire input focus for the GO that contains the collection proxy as it is passed on and that solved my issue . For anyone else having this issue, just add a script acquiring input focus !
We are not updating the old editor with new functionality and we will very soon deprecate it completely. The new editor should be 100% backwards compatible. Please update!
It might be related to a cache-issue we’ve seen lately. Could you try going to APPDATA/defold and deleting the cache folder and see if that resolves the issue.