Can I call methods on components in an Action track?

Slate Forums Support Can I call methods on components in an Action track?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1742
    dgoyette
    Participant

    For Property tracks, I can drill down to pretty much any component on a game object and choose a property to manage. I’d like to do something similar for an Action track, where instead of choosing a property, I can choose a method to call. Is there a kind of Action that supports this? Or is SendMessage the only option for calling arbitrary messages on a component? If so, the method I want to call takes an Enum parameter that needs to be passed in. Can I call this kind of method using Slate?

    Thanks.

    #1743
    Gavalakis
    Keymaster

    Hello,

    Indeed, right now the only option available to call a function from within Slate, is to use the “SendMessage” action clip, although I do plan to add more advanced reflection based clips for that.

    The default/existing SendMessage variants can not send a custom enum type as a parameter, but because the base class of SendMessage action clip, is a generic class, you can create a super simple custom action clip, to send the type you want as a parameter like this:

    Simply replace “MyEnum” with any type you want and it will work 🙂
    Just make sure to keep this custom action clip outside of the Slate folder, to avoid accidentally deleting it when updating Slate in the future.

    Let me know if that works for you.
    Thanks.

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

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