Animation Best Practices

Forums 💬 NodeCanvas 🗨️ General Discussion Animation Best Practices

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #13913
    yulaw2k
    Participant

      I am trying to create a modular system of different nested trees inside of an FSM top level like I have seen the creator of NodeCanvas suggest.

      Right now I have behaviors on trees but alot of animations done the traditional way through scripts.

      Has anyone come about a good practice that is working well for them?

      #13917
      Gavalakis
      Keymaster

        Hello there,

        If you already have custom scripts functions on some of your MonoBehaviours that play animation, you can use “Script Control” actions like “Call Function”, to call those functions directly through reflection.
        I think that I misunderstood your question though, and what you want to achieve 🙂 .
        Can you please provide a bit more info so that I can provide a better answer?
        Thanks!

        #13916
        yulaw2k
        Participant

          Different question. Can NodeCanvas handle animation events?

          #13915
          arachnidjacob
          Participant

            You can set up any callbacks you want in node canvas.

            So you would hook up an animation event to something like this

            In your monobehaviour you would have a basic function that connects to the node canvas.
            [attachment file=”12298″]

            In the node canvas custom condition or action, you would register it with the [EventReciever(“recieverName”)] class decorator
            [attachment file=”12299″]

            and then you would get that class as a condition or action node that will fire when the event is called
            [attachment file=”12300″]

            #13914
            Gavalakis
            Keymaster

              Hello,

              Another way, would be to select the “SendEvent” function for the target function to be called by the Animation Event in it’s inspector and give it a name:
              [attachment file=”AnimationEvent.png”]

              Then within NodeCanvas graph, you can use the existing “Check Event” condition, and set the event name to be the same as the one you set in the inspector above (in this case, “MyEventName”).
              [attachment file=”AnimationEvent2.png”]

              As such, whenever the Animation Event is encountered, a NodeCanvas event named “MyEventName” will be send to the owner graph and the “Check Event” condition will return true for that same frame, thus “OK” will be logged for the above example.

              Let me know if you need more clarification on this.
              Cheers.

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