How to communicate with other scripts on other GameObjects

FlowCanvas Forums Support How to communicate with other scripts on other GameObjects

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1442
    the_taco_tony
    Participant

    How is communicating with other scripts done using FlowCanvas?

    – I’ve found the ability to send messages however I do not understand how to receive them. Can someone please explain?

    – Can I read/write a variable on another script (flow or C#)?

    – Do Custom events work on other scripts on other GameObjects?

    Thank you.

    #1444
    Gavalakis
    Keymaster

    Hello,

    – The easiest way to get/set a property, or call a function on a c# script component attached on any gameobject, is to simply drag & drop that gameobject in the FlowCanvas editor. Doing so will open up a menu where you can select the target property you want to read/write, or the function to call.

    – To call a Custom Event node in a flowScript…
    — …From another flowScript, you need to use the ‘Send Event’ node and assign in that node, the target flowScript object as well as the Event name to call.
    — …From a c# script you need to call SendEvent function on the FlowScriptController class, something like this: GetComponent<FlowScriptController>().SendEvent("MyEventName").

    Please let me know if that helps, or if you need more details.
    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.