Locomotion

Setting Up a Vehicle



Enable VR expansion plugins

Import a car mesh that has 4 wheels skeleton, connect to a centre base
image.png
Check in static mesh if physics asset is there.
if no, create one:
image.png
Adjust the size of physics that fit the wheels
image.png

Create a VR character BP, and VRWheeledVehicle BP (or use VR pawn, if no VR expansion plugin)
image.png
Open the Vehicle BP
Replace the mesh
In Vehicle movement component, open Wheel Setups, add 4 elements
image.png

In car skeletal mesh, copy the bone name of the wheel
image.png
Paste in the wheel setup in Vehicle BP
Repeat on all 4 wheels
image.png
Change Wheel class for front wheels and back wheels respectively
image.png
If no front/rear wheels from the import model, create one and roughly set the parameter as below:
Front wheel steer angle 70, rear wheel steer angle 0
image.png

Open VR Player BP:
(set up player automatically place in vehicle and control it, not by triggering to get in the vehicle, etc)
Add variables. make it visble:
image.png
Steer can connect to either input action node, or just Get input node
image.png
OR if using enhanced input?
image.png

Drag the Vehicle and VR player in the scene,
Let Vehicle over the Player, set as steeringwheel (test later if the player position in car correct)
image.png
image.png
Choose the vehicle in default in VR player details
image.png
Set no collision to all Collision options in the VR player
image.png
Recheck no simulate physics and gravity set as below:
image.png
image.png
Set auto posses as player 0
gravity scale 0
image.png
Set the player inside the car
image.png

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.