Vehicle Changer
Vehicle changer is used to switch between the vehicles. It supports instant switching or character enter/exit type switching, depending on the Character Based
option.
- For script to auto-find vehicles in the scene, tick the
Auto Find Vehicles
option. Vehicles that haveSettings > Register With Vehicle Changer
set totrue
will get added to the list.
Instant Vehicle Switching
- Pressing
ChangeVehicle
(Input Setup) button will switch to the next vehicle inVehicles
list. When the last vehicle is reached it will wrap around and start from the first vehicle again.
Character-based Vehicle Switching
- When
Character Based
switching is enabled the only way to change the vehicle is to exit the current one (some kind of 1st or 3d person character controller is assumed), walk to the next vehicle and press theChangeVehicle
(Input Setup) button.
- Make sure that the
Character Object
is assigned. This is a GameObject containing the character controller. The asset does not care which character controller is used as it will simply deactivate the character controller GameObject and give the control to the vehicle that is being entered. - The points at which the character can enter the vehicle are set by adding empty GameObjects as children to the vehicle and tagging them with the
Enter Exit Tag
, which isEnterExitPoint
by default. Check the demo scene vehicles for the example, e.g. the Niva has the LeftEnterExitPoint only, which means that the character can exit only from the left (driver) side. Duplicate it and move it to the right door position to make entering from the passenger side possible too. - When exiting the vehicle, the character will re-appear at the position it entered. So, if it entered from the left side it will re-appear on the left side when exiting.