[BUG] Node became "detached" and doubling, when Unity Editor window lost focus

NodeCanvas Forums Support [BUG] Node became "detached" and doubling, when Unity Editor window lost focus

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #13070
    egnech
    Participant

    Hey!

    I’m trying to switch from GOAP to NodeCanvas, and faced with some strange issue…
    Here is the screen capture instead long description – https://cl.ly/0v0G3u2T0T3g
    So, to reproduce them you need to:

    1. create a sample BT
    2. save scene and relaunch Unity (this step can be dropped, cause it just to get “clean” results)
    3. open Canvas window and select any node
    4. switch to another application (or make Unity Editor window lost focus)
    5. switch back

    As you can see the node appears at different position, and it lost connection to parent node, and now it .

    6. Try to repeat step #4, but now don’t select any nodes.

    As you can see now a new (previously selected node) is just added to canvas.

    It feels like it just copy/pasted after step #4.

    Unfortunately, this makes impossible to work with NodeCanvas for me now 🙁
    Can you please suggest me any solution for this issue?

    PS. It is more like feedback, not a bug, but navigation window (at bottom right) is painful.
    PPS. But overall – I believe that NodeCanvas is exactly what I looking for 😉

    #13071
    egnech
    Participant

    A small update.
    Looks like this issue appears only if mouse cursor is at Canvas Window space.

    Also forget to mention, I’m using the latest Unity version on macOS.

    #13073
    Gavalakis
    Keymaster

    Hello and sorry for the late reply (I was ill).
    This is super weird. Under Windows OS this does not happen at all (on any Unity version), so this has to be a MacOS thing but it’s still very weird that this happens at all :(. I can’t think of any reasons why the node is being moved or even duplicated simply by switch apps.
    I will try find any part of the code that might be responsible for this.

    Thanks for the report.

    Join us on Discord: https://discord.gg/97q2Rjh

    #13083
    egnech
    Participant

    Hey! Hope you are OK now!

    I have a filling that this topic is somehow related to my issue too.

    I see that you have attached a package there, I’ll try it tomorrow.

    #13096
    tadej
    Participant

    The exact same thing is happening to me. I wrote you an email thread a while ago …

    Hope you can get it fixed somehow, we’ve invested a lot of time in writing upgrades for NodeCanvas for multilanguage dialogs and now this is a very annoying blocker :/ …

    #13097
    tadej
    Participant

    Here’s a stack trace of what gets called when the node is duplicated (or rather pasted) on switching back to unity:

    #13098
    tadej
    Participant

    Again, for clarification, here’s the NodeCanvas code that gets called on macOS that shouldn’t be called when cmd+tabbing back to Unity.

    #13115
    egnech
    Participant

    Any news here? 🙂

    #13119
    Gavalakis
    Keymaster

    Hello again,

    I am feeling better now. Thank you!

    Can you please try and change the following in the code you’ve posted and let me know if the problem persists?

    Please change this line:
    if (e.type == EventType.ValidateCommand || e.type == EventType.Used){

    To this:
    if (e.type == EventType.ValidateCommand){
    (thus removing the EventType.Used check)

    Please let me know.
    Thank you!

    Join us on Discord: https://discord.gg/97q2Rjh

    #13133
    tadej
    Participant

    Hi again!

    Good to hear you’re feeling better!

    Unfortunately no: https://www.dropbox.com/s/tcx6n5r16327q91/nodecanvas-issue-03052018.mov?dl=0

    -Tadej

    #13134
    tadej
    Participant

    The version below seems to work better, although I get this issue:
    ArgumentException: Getting control 0’s position in a group with only 0 controls when doing Repaint
    Aborting

    #13147
    Gavalakis
    Keymaster

    Hello again,

    Thanks for the follow up.
    This is so weird. I think that I might just as well remove the copy/paste shortcuts from MAC considering that (at least in the way I’ve implemented) they impose such a big problem and I don’t really understand why that is the case as of yet :(.
    I do some more tests before deciding to do so though.

    Thanks again for the information provided and of course for the problem found.

    Join us on Discord: https://discord.gg/97q2Rjh

    #13152
    tadej
    Participant

    Looking at the documentation for ValidateEvent:
    https://docs.unity3d.com/ScriptReference/EventType.ValidateCommand.html

    Is it possible that this is the intended behaviour and it just happens to work fine on Windows?

    I haven’t really dug into it very deeply so sorry for speculating.

    Anyway, the above fix seems to work pretty well for me so far.

    #13160
    Gavalakis
    Keymaster

    Hey,

    Thanks for the follow up and sorry for the late reply.
    Unfortunately this is not the first and only differences between Win and Mac OS regarding the Unity’s UI and event system that have occurred to me thus far. ContextClick is another “inconsistent” event type between Win and Mac that I remember for example, and sometimes workarounds are needed to make them work in both OS.

    I will check your posted fix on Windows and if it does not create an issue in Windows as well, then I might just as well implement your fix, considering it is working under Mac. 🙂

    Thank you!

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.