uScript ships with a script that you can use to remotely trigger logic in uScript called BroadcastCustomEvent.cs. The most popular use for this script is to trigger uScript logic from Unity's Animation Event system.
This can be very useful for uScript logic you wish to trigger based on a specific animation (or frame of an animation).
To use this script in your own project, follow these steps:
1. Assign the component to the GameObject with the animation you wish to add an Animation Event on:
You will now have this script component on the GameObject:
2. Then create a new Animation Event in an existing animation for your GameObject and select the uScript function (uScript_Broadcast_Custom_Event), as well as provide the Event Name you wish to broadcast (AnimTestName in this case):
3. Now you can go into uScript and create a Custom Event event node and any following logic you wish to run when AnimTestName is broadcast:
Note! - those also familiar with scripting can also use this script in other script files to also trigger logic from outside of uScript.