VRTK_DashTeleport
extends VRTK_HeightAdjustTeleport
Overview
Updates the x/y/z
position of the SDK Camera Rig with a lerp to the new position creating a dash effect.
Script Usage:
- Place the
VRTK_DashTeleport
script on any active scene GameObject.
Script Dependencies:
- An optional Destination Marker (such as a Pointer) to set the destination of the teleport location.
Inspector Parameters
- Normal Lerp Time: The fixed time it takes to dash to a new position.
- Min Speed Mps: The minimum speed for dashing in meters per second.
- Capsule Top Offset: The Offset of the CapsuleCast above the camera.
- Capsule Bottom Offset: The Offset of the CapsuleCast below the camera.
- Capsule Radius: The radius of the CapsuleCast.
Class Events
WillDashThruObjects
- Emitted when the CapsuleCast towards the target has found that obstacles are in the way.DashedThruObjects
- Emitted when obstacles have been crossed and the dash has ended.
Unity Events
Adding the VRTK_DashTeleport_UnityEvents
component to VRTK_DashTeleport
object allows access to UnityEvents
that will react identically to the Class Events.
- All C# delegate events are mapped to a Unity Event with the
On
prefix. e.g.MyEvent
->OnMyEvent
.
Event Payload
RaycastHit[] hits
- An array of RaycastHits that the CapsuleCast has collided with.
Example
VRTK/Examples/038_CameraRig_DashTeleport
shows how to turn off the mesh renderers of objects that are in the way during the dash.
Updated less than a minute ago