Firing Events from code
4_ScriptableEvent
Last updated
4_ScriptableEvent
Last updated
Events are useful to trigger things like VFX, menus, or even gameplay elements. Let’s look at the events that are fired from Health.cs on the prefab_player.
OnPlayerDamaged -> ScriptableEventInt
OnPlayerHealed -> ScriptableEventInt
OnPlayerDeath -> ScriptableEventNoParam
It is simple to fire these events from code, you simply call the Raise() method. Here is an example in Health.cs: