Mouse update not working in new collection (SOLVED)

Hello folks!

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>”


Also, I am using Editor 1.

Would love any ideas you might have :slight_smile:

Cheers!

Ok hello again!

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 :slight_smile: . For anyone else having this issue, just add a script acquiring input focus !

Cheers

2 Likes

You should really switch to the new editor!

2 Likes

Yeah I know, everything should work the same, right? Im worried I’ll have to rework things of I update :sweat_smile:

1 Like

Everything should work with no need to change things. You can download the new editor and test it without being forced to permanently switch.

1 Like

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!

2 Likes

Ok, I’ll try updating it then. Thank you for your answers :slight_smile:

1 Like

So I am trying the new editor and while building my project I am getting this error. Just downloaded my old version from the old editor.

Any ideas?

Sk%C3%A4rmklipp

Cheers!

1 Like

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.

Hm, that did not seem to resolve the issue :confused: Still recieving the same error message. Are there any system/software requirements for the new editor?

Platform requirements are in the FAQ but shouldn’t be much different from the old editor.

@Erik_Angelin and @mats.gisselson might have some ideas? Do you have a JAVA_HOME variable in your system env? Perhaps try to unset that.

1 Like

I should also note that bundling the project as an application works as usual.

Where do I unset the JAVA_HOME variable?

Thank you for your help :slight_smile:

Please press Report in the dialog, that way we get a stacktrace and some basic information to go on. Don’t think JAVA_HOME is involved. Thanks!

2 Likes

Ok, done! Let me know if you know what might be the problem :slight_smile:

2 Likes

Issue was an invalid image reference in an atlas.

2 Likes