Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to use Event Dispatchers in the Visual Scripting?

Discussion in 'Visual Scripting' started by DryreL, Jan 30, 2023.

  1. DryreL

    DryreL

    Joined:
    Feb 23, 2020
    Posts:
    49
    Hi!

    I want to know how to use Event Dispatchers in the Visual Scripting just like in the Unreal Engine.



    Thank you in advance!
     
  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,049
    Last edited: Jan 30, 2023
    DryreL likes this.
  3. DryreL

    DryreL

    Joined:
    Feb 23, 2020
    Posts:
    49
    I done the following screenshots for the UI button events. It works.

    But I'm not sure to adding events from Inspector. I would like to add it from the UVS itself, but I'm using prefab as base buttons and override them in the variable such as button name (it sets On Start).

    upload_2023-1-30_23-30-44.png

    upload_2023-1-30_23-32-25.png

    upload_2023-1-30_23-32-56.png

    upload_2023-1-30_23-34-4.png

    Rather than adding from the Inspector (marked as green box), I want to override and call an EventListener from On Button Click() event for each prefab buttons.

    upload_2023-1-30_23-37-54.png
     
  4. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,049
    I'm not sure I understand your problem, On Button Click can trigger a custom event. And you can swap out graphs in ScriptMachine component as prefab overrides.