VRTK_PlayerClimb
Overview
This class allows player movement based on grabbing of VRTK_InteractableObject objects that are tagged as Climbable. It should be attached to the [CameraRig] object. Because it works by grabbing, each controller should have a VRTK_InteractGrab and VRTK_InteractTouch component attached.
Inspector Parameters
- Use Player Scale: Will scale movement up and down based on the player transform's scale.
- Use Gravity: Will allow physics based falling when the user lets go of objects above ground.
- Safe Zone Teleport Offset: An additional amount to move the player away from a wall if an ungrab teleport happens due to camera/object collisions.
Class Events
PlayerClimbStarted- Emitted when player climbing has started.PlayerClimbEnded- Emitted when player climbing has ended.
Unity Events
Adding the VRTK_PlayerClimb_UnityEvents component to VRTK_PlayerClimb object allows access to UnityEvents that will react identically to the Class Events.
OnPlayerClimbStarted- Emits the PlayerClimbStarted class event.OnPlayerClimbEnded- Emits the PlayerClimbEnded class event.
Event Payload
uint controllerIndex- The index of the controller doing the interaction.GameObject target- The GameObject of the interactable object that is being interacted with by the controller.
Example
VRTK/Examples/037_CameraRig_ClimbingFalling shows how to set up a scene with player climbing. There are many different examples showing how the same system can be used in unique ways.
Updated less than a minute ago
