VR Expansion Plugin Documentation

4.3.VR Character

VR Character Actor is a new character class that is heavily modified to work in VR. It automatically populates with two GripControllers, a ParentRelativeAttachment, a ReplicatedVRCamera and a VRCharacterMovementComponent. The mesh that is standard to characters is reparented to the ParentRelative component and the root component is overridden with a VRRootComponent. Several new functions and variables are provided to assist in VR development with this character and it has unique properties that as far as I know are currently not implemented anywhere else.

Why Use It

If you want a gameplay orientated player pawn instead of a “ghost with floating head and hands” you would be well served with this.

The VRCharacterActor has full level collision like a standard Character and the collision follows your HMD using the VRRootComponent. It also uses all of the movement and replication capabilities of the standard character with some modifications to get it to work better in VR.

By default it blocks sticking the players heads through solid geometry, this is optional and you can enable being able to clip through objects in the settings for the actor if you wish.

Notes

  • The standard movement tick order is overridden in this actor to get things smoother.
  • Physics objects are auto set to not be steppable in this, physics interactions with pawns has many cases where it can / will throw the pawn around and cause instant issues with the player. If you don’t need the body of the player to interact with physics objects I would highly suggest turning the physics collision channel to overlap or ignore. That will also prevent the character capsule from pushing away physics objects that the player is trying to pick up.

To turn back on steppable physics objects go to the VRMovementComponent and flag IgnoreSimulatingComponentsInFloorCheck to false.

  • To use the navigation features and have everything work the player controller owning this character HAS to be derived from VRPlayerController. If you don’t want to use navigation then don’t use the nodes and the player controller base type no longer matters. This is to force the character to use a custom PathFollowingComponent.

How do I use it?

  • Create a VRCharacterActor as your pawn and add movement and interaction logic as you would a normal game character.

Variables

Events

Event ReceiveNavigationMoveCompleted This event triggers in the VRCharacter graph when a pathing operation has completed and returns why it ended.

Functions

Note See BaseVRCharacter for most of the functions

TeleportTo – The standard teleport function is overridden in this character, it will automatically call the GripMotionControllers – PostTeleportMoveActors() function in it.

GetMoveStatus Returns the path following components current move state.

HasPartialPath Returns if the current navigation path is partial or not.

StopNavigationMovement Stops all navigation instantly.

ExtendedSimpleMoveToLocation An extended SimpleMoveToLocation that adds some of the features of the movement functions in the AIPlayerController.

Networked / Multiplayer Setup

You shouldn’t have to do anything differently for networked games. Just be sure to check the child components for their network specific entries, things like the gripcontrollers have notes in networking.

Examples

Typical movement (based on where you are looking), you can actually bind to the input system and override the Forward and Right inputs just like a normal character as well. This image is just to show that using input vector nodes directly works.

Movement.jpg

Typical jumping

Jumping.jpg

Suggest Edit