Dash System

Description

Allows players to use dash. Includes a simple magnetizing system to simplify dashing to particular spots.

How it Works

The example scene contains a “DashSystem” object with a script of the same name which controls the dashing behavior.

Whenever the player presses shift (on Desktop) or pulls both triggers (in VR) - they will be propelled forward along their view direction. The velocity is applied only horizontally, keeping whatever vertical velocity the player already had before.

There are also cubes scattered across the scene with a “DashMagnetizedZone” script on them. When entering the area of a magnetized zone while dashing - the player will be pulled toward the reference transform of that zone.

This makes it easier to land on a floating block without undershooting/overshooting it.

When the player is close enough, or the dash ends - the zone will stop pulling the player towards its center allowing them to dash again.


How to Use This Example

Open the provided scene and enter playmode. Press shift and enjoy the dashing!

You can adjust the Dash settings on the DashSystem object, and the Magnetized Zone settings on the “Magnetizer” object inside the “VRC Cube Mangetizer” prefab.

Limitations

  • There is currently no mobile UI for dashing
  • To avoid odd behaviors it is recommended to set walk and run speeds to the same value on the VRCWorld prefab
3 Likes