Animation Best Practices

NodeCanvas Forums General Discussion Animation Best Practices

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12275
    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?

    #12276
    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!

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

    #12294
    yulaw2k
    Participant

    Different question. Can NodeCanvas handle animation events?

    #12297
    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.
    sonarSender

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

    and then you would get that class as a condition or action node that will fire when the event is called
    canvasView

    Attachments:
    You must be logged in to view attached files.
    #12308
    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:
    AnimationEvent

    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”).
    AnimationEvent2

    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.

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

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