Player Car
Common Info
Each player car only works in Hybrid custom physics type & consists of 2 parts: DOTS entity is handled by DOTS systems & Monobehaviour hybrid skin (required for camera tracking & npc car layout) that follows the binded DOTS entity.
Player hybrid skin car should have following components:
Player Actor : camera tracking component.
PlayerNpcCarBehaviour : logic of the NPC shooting from the car.
CarSlots : stores the NPC data that is in the car (Npcs sitting in the car are taken from the PlayerNpcCarFactory).
Note
Look at PlayerCarSkinBase prefab example.
Hybrid DOTS
Player vehicle physics handled by DOTS systems.
The hybrid skin follows the DOTS entity.
How To Create
Open Car Prefab Creator & set Car type to Player in the Prefab tab.
Create a vehicle using the Car Prefab Creator tool.
Create prefab variant from the PlayerCarSkinBase prefab & assign to Player Car Pool according to the vehicle.
Customize the car slots in the created prefab if you plan to make the NPC’s shooting option from the car [optional step].
Enable spawn type to Car & select desired Car model from the list in the PlayerSpawner, if you want the player to spawn in a car initially [optional step].
Once all the steps have been completed, reopen subscene.
Hybrid Mono
Player vehicle physics handled by custom user’s Monobehaviour physics plugin.
Unlike the Hybrid DOTS, the entity following & presents collider for DOTS world without mesh representation.
- List of vehicle controllers from the Asset Store that can be used for (e.g.)
How To Create
Set the World simulation type to Hybrid mono in the General settings config (make sure that config on the subscene has the same value).
Open the Car Prefab Creator & set Car type to Player in the Prefab tab.
Set Entity type to Hybrid entity mono physics in the Save tab.
Drag & drop your desired prefabs into the Prefabs field.
Click the Scan button.
Customize Save settings in the Save tab.
In the Prefab Info tab, enter the vehicle ids (ids should match the traffic cars ids if you want to make option enter & exit for the player npc).
Click the Create button.
Ensure that the bounds of the entities created match the prefabs you have selected.
Input for the player vehicle is implemented according to your vehicle controller plugin.
The input enable & disable for the car when the player’s npc exits & enters the car should be implemented in the PlayerInteractCarService.cs in the EnterCar & ExitCar methods.
Enable spawn type to Car & select desired Car model from the list in the PlayerSpawner, if you want the player to spawn in a car initially [optional step].
Once all the steps have been completed, reopen subscene.
Player Car Pool
Where To Find
In the scene:
Hub/Pools/Car/PlayerCarPool![]()
How To Use
Player cars spawned by PlayerCarSpawner.