MessageRouter and OnAnimatorMove

Forums 💬 NodeCanvas ⚙️ Support MessageRouter and OnAnimatorMove

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17611
    avatech
    Participant

      I found a possible bug in MessageRouter.cs in NodeCanvas 2.7.0.

      Whenever I use EventReceiver attribute in a task and have Animator component on the same GameObject as the FSM / BT, NodeCanvas will attach MessageRouter script into the GameObject.

      The problem is that MessageRouter.cs contains OnAnimatorMove and OnAnimatorIK methods, which by Unity default, will override Animator component’s behavior, disabling all the animation that involves Transform in any clips.

      My suggestion for the next build is to separate these methods into other “router” component, so that only if we specifically use [EventReceiver(“OnAnimatorMove”)] in the task, then this specific “router” is summoned.

      Or is this an intended behaviour?

      #17614
      Gavalakis
      Keymaster

        Hello,

        Hmm. The MessageRouter indeed contains “OnAnimatorMove” callback, but it is made so that it applies the built in root motion if there is no receiver for that event.

        Thus, considering I didn’t miss anything, if you don’t actually subscribe for an OnAnimatorMove event in any of your tasks, there won’t be any difference, since the built-in root motion will be used, instead of being completely overridden.

        Does the root motion not being applied even though you haven’t subscribed for OnAnimatorMove event in any of your tasks?

        Please let me know.
        Thanks.

        #17613
        avatech
        Participant

          Hi,

          The way to replicate this bug is let say I have a GameObject, inside that GameObject, I put:
          – An Animator component
          – A Sprite Renderer
          – A FSM / BT + Blackboard (empty)
          – A MessageRouter

          Even in the editor, after I add MessageRouter, the Apply Root Motion in Animator component will show as “Handled By Script”. But if I commented those lines of code, the Apply Root Motion toggle goes back to normal.

          By the way I used Unity 2017.2.

          #17612
          Gavalakis
          Keymaster

            Hello again,

            Sorry for the late reply.
            Indeed the “Apply Root Motion” in the animator shows as “Handled By Script”, but what I am saying is that the script (MessageRouter) then applies the root motion back. So in essence, even if root motion is overridden, all that the override does, is apply the default/built-in root motion back, so in practice it is like override never happens.
            Does that made sense? 🙂

            Thanks.

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