When Vehicle Refreshes
Fires when the vehicle spawner refreshes, a new vehicle becomes available.
Introduction
When Vehicle Refreshes is an event in the Vehicle Spawner group of World Events. It fires when the vehicle spawner refreshes, a new vehicle becomes available. Like every event, it does nothing by itself. It waits for the right moment, then runs all the actions connected to it. Use it when you want something to happen automatically as soon as the vehicle spawner refreshes its vehicle. This event belongs to the Vehicle Spawner component. Open the Vehicle Spawner component guide to see everything the component itself can do. Refresh keeps the garage stocked: this event fires each time the spawner restocks a vehicle, working alongside When Vehicle is Picked Up when a player takes one. What happens during the drive - pedals, speed, sliding - lives in the vehicle family, and spawner intervals are configured in the Vehicle Spawner guide. When Vehicle Refreshes event in the World Editor Image The When Vehicle Refreshes event in the Script Editor. caption
Parameters
None This event has no parameters. The event fires on its own and everything you need is the object running this script. Parameter Description
How to Access
How to Access - Event When Vehicle Refreshes
How to Use
Select the object, press Propertie (the blue equalizer icon) in the bottom action menu, and scroll to the bottom of the properties panel. Press Add Component and pick the Vehicle Spawner component; its block stacks below the existing properties with the When Vehicle Refreshes event inside it. Press the + button below the event to add a script, then press Edit on that script to open the script editor and build the actions that should run when the event fires. Press Play and wait for the spawner to refresh the vehicle, then check that the actions run.
Example
When Vehicle Refreshes: Execute System Environment.Play Audio Audio 8bit Story, Volume 100 when-vehicle-refreshes-example.png Plays an audio cue whenever the vehicle spawner refreshes and places a new vehicle. caption
Common Uses
Show a spawn animation when a fresh vehicle appears Reset race or garage logic for the new vehicle Update UI that tracks vehicle availability
Tip
Handy for race modes: react each time a replacement vehicle rolls out.