Mouse update not working in new collection (SOLVED)


#1

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!


#2

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


#3

You should really switch to the new editor!


#4

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


#5

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


#6

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!


#7

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


#8

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!


#9

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.


#10

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?


#11

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.


#12

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:


#13

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!


#14

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


#15

Issue was an invalid image reference in an atlas.