Error when moving reflected method from class to a base class

NodeCanvas Forums Support Error when moving reflected method from class to a base class

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9640
    Async0x42
    Participant

    I have two classes for example. NPC which inherits from BaseMobile.

    I have a StopMoving function in NPC, which is reflected in a behaviour tree, but then I move it to BaseMobile (or vice versa).

    When loading the behaviour tree, I get the following error spammed and almost locks up Unity completely. I’m not sure if it’s just a bug that’s allowing it to do that, but if not, perhaps some kind of catch so that it shows Empty Method similar to if the method was removed (or re-does the reflection, since the method was reflected via NPC and is still available after moving to BaseMobile since NPC inherits from it)

    Hope that made sense… I’m not great at explaining, but thanks for your work on NodeCanvas, I’ve tried a few and this is definitely my best purchase on the asset store!

    #9642
    Gavalakis
    Keymaster

    Hello and thanks!

    I am glad you like NC 🙂

    I just tried reproducing this and didnt throw errors, but I am using a more latest version than 2.2 which is on the asset store, which I’m going to submit soon.

    Would you mind opening up SerializedMethodInfo.cs and add this null check there under method “Get”?

    I could also send you the latest version if you like to your email.

    Thanks!

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

    #9641
    Async0x42
    Participant

    I applied that change and I can’t seem to reproduce the error, plus the method still displays even after moving it between class / sub-class.

    Unless I did something that I don’t remember which caused it, the fix seems to work, thanks! Looking forward to your next version!

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