How to enter and exit from a vehicle

On this page, you will learn how to setup the enter-exit vehicle system.

Any vehicle can be controlled by the player, basically the entry system will disable the character controls and enable the vehicle control.

To drive a Vehicle the character must have the Drive Vehicle System

Property
Description

Start Vehicle

A default vehicle to start driving

Enter Vehicles Enabled

If true, the character can enter and drive vehicles.

Exit Vehicles Enabled

If true, the character can exit from the Vehicle if is driving.

Disable Character On Enter

Disable the character after enter on the vehicle, usefull for vehicles that not have IK settings for drive animations.

Delay To Re enable Action

The time to reactive enter vehicle action after start enter or exit of some Vehicle. Can't be less than 0.1.

Max Vehicle Speed To Exit

Don't allow to exit from a vehicle on high speeds.

Ground Layer

The layer used to detect the ground to set the character position when exit from the current vehicle.

How vehicle detection works ?

Vehicles must have a child trigger with a specific tag and layer, the trigger must have a JU Vehicle Interactable to work.

The Player needs to have a JU Interaction System, which will detect the vehicle's trigger.

Characters without driver animations

For simple games you can disable the character instead of use complex animations and IK system.

Simple Character Driver Animation

If you have a character animation that match with the vehicle model you can use the JUVehicleCharacterIK to set the character position inside the vehicle.

Advanced Character Driver Animations with IK

You can use foot and hand IK on vehicles if you want, very useful to make wheel steer, motorcycle inclination animation or foot placements.

To use it, the character must have the DriverProceduralAnimation component, it's is responsible by the IK system.

Furthermore, you need to have assigned all the IK target positions on the JUVehicleCharacterIK of the vehicle and the IK weights configured.

circle-check

Standard IK Settings

Inverse Kinematics Target Positions
Description

Character Location

Character body position in vehicle

Left Hand Position IK

Left hand position and rotation in vehicle

Right Hand Position IK

Right hand position and rotation in vehicle

Left Foot Position IK

Left foot position and rotation in vehicle

Right Foot Position IK

Right foot position and rotation in vehicle

IK Animation Weights Parameters
Description

Frontal Lean Weight

Frontal Lean Motion Weight IK

Side Lean Weight

Side lean Motion Weight IK

Look At Direction Weight

Look At Motion Weight IK

Hint Movement Weight

Hint Motion Weight IK

Foot Placement

Foot placement in driving (Motorcycle or Bike for example)

Last updated