Firstborn/Library/PackageCache/com.unity.visualscripting@1.../Documentation~/vs-events.md
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

747 B

Events API

Note

For versions 2019/2020 LTS, download the Visual Scripting package from the Unity Asset Store.

Visual scripting provides a simple API to trigger custom events from C# script.

Usings

Add the following usings to your C# script to access the API.

using Unity.VisualScripting;

Triggering

A single method call is needed to trigger a custom event. Pass as many arguments as required.

CustomEvent.Trigger(targetGameObject, argument1, argument2, ...)

For example, this custom event node:

Can be triggered with this line of code.

CustomEvent.Trigger(enemy, "On Damage", 30);