When Sliding
Fires when the driver releases the gas and the vehicle coasts freely.
Introduction
When Sliding is an event in the Vehicle group of World Events. It fires when the driver releases the gas and the vehicle coasts freely. Like every event, it does nothing by itself. It waits for the right moment, then runs all the actions connected to it. Use it for the coasting mood: the engine dropping to idle, wind sounds taking over, or a drift indicator appearing. When it fires, the event hands one value to your script: player, the player this moment belongs to. This event belongs to the Vehicle component. Open the Vehicle component guide to see everything the component itself can do. Sliding is the fun loss of control: this event pairs with When Speed Up to describe how a vehicle moves, and the driver who caused it arrived through When Player Gets On . Grip and drift physics are configured in the Vehicle Asset guide. When Sliding event in the Uni editor Image The When Sliding event in the Script Editor.
Parameters
Player the player driving the vehicle Parameter Description
How to Access
How to Access - Event When Sliding
How to Use
Select the vehicle in the World Editor and open its Propertie (the blue equalizer icon), then scroll to the Vehicle section — the When Sliding event is already listed there under Vehicle Events. 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, drive the vehicle, then release the gas and check that the actions run while coasting.
Example
When Sliding: Execute Player.Mobile Phone Vibration Shake in Light mode Brief when-sliding-example.png Sends a brief light vibration to the player's phone while the vehicle coasts. caption
Common Uses
Coasting and wind sounds Drift or freewheel indicators Silent approaches in stealth driving
Tip
Coasting keeps momentum, so use this window for effects that depend on quiet: the engine drops, the world gets louder.