Car Prefab Creator
How To Use
From the Unity toolbar, open Car Prefab Creator.
Spirit604/CityEditor/Car Prefab Creator
Drag & drop source cars from scene or project to Prefabs field depends on Prefab Source Type parameter.
Configure the Common settings for creating a car.
If the vehicle is the Simple vehicle type, enable Add wheel offset in the Common settings tab.
Custom physics entity shape result example
Simple physics entity shape result example
Configure the Save settings for creating a car.
Change the Template settings depending on the name of the car body (if it is a child) and the pattern of the names of the wheels.
Click Scan button.
Open Additional Settings tab, adjust common settings for all vehicles.
After, open Prefab Info tab, adjust unique settings for each vehicle.
Once all the settings have been customised, click Create to create the prefabs.
Prefab Settings
- Prefab source type:
- Scene
Targets prefab parent : prefabs will be taken from the selected root from the scene.
- Project
Prefabs : selected prefabs from the project.
- Car type:
Traffic : prefab car will be created for the traffic.
Player : prefab car will be created for the player.
Common Settings
- Assign hull mesh: should find the hull of the car.
Parent is hull mesh : car root contains a car mesh.
- Has navmesh obstacle: does the car contain NavMeshObstacle component.
Move threshold
Carve stationary
Carve time to stationary
- Add offset: offset of the vehicle hull along the Y axis.
Fix pivot : fixes the pivot point if the pivot point is in the centre of the mesh.
Add wheel offset : adds wheel offset size.
Local offset : custom offset value.
Save Settings
- Save to exist preset:
- New preset settings:
- Prefab save type:
Override source : selected prefabs will be replaced by new ones.
Create new if not exist : new prefabs will be created only if there are no previously created ones by the selected path.
Override target : previously created prefabs will be overwritten in case of a duplicate.
- Prefab save path type:
Original prefab path : prefabs will be created in the directory where the selected prefabs are located.
Template prefab path : Prefabs will be created in the directory where the template is located.
Custom path : user’s path of creation.
- Collection edit type:
Add to exist : add vehicles to exist vehicle collection.
Override : overrides vehicle collection by created vehicles.
- Material type:
Source : material is copied from the source prefab.
Custom atlas material : user’s custom atlas material.
New unique material : new material is generated based on the user’s own material.
Template Settings
- Wheel name templateskeyword phrases for automatic wheels searches.
Wheel FR : forward right wheel.
Wheel FL : forward left wheel.
Wheel BR : backward right wheel.
Wheel BL : backward left wheel.
Wheel Middle : additional wheels.
Preview Settings
Additional Settings
Common Settings
Note
Editing additional parameters will affect all cars in the Prefab Info tab, to make unique parameters check the toolbox opposite on the parameter in the Prefab Info.
Arrow-button applies the setting for the selected parameter.
Physics
Info Tab
Graphics
- Wheel source type:
Model unique : the wheels remain as in the original model.
Shared from model : the wheel model selected by the user from the original model is used for all wheels.
Shared all : the wheel model selected by the user shared between all wheels.
- Wheel rotation type [shared wheel only]:
Source : the wheel rotation remains unchanged.
Flip left row : rotate the wheel in the left-hand row by 180° if you are using the wheel model from the right-hand row.
Flip right row : rotate the wheel in the right-hand row by 180° if you are using the wheel model from the left-hand row.
- Has lods: on/off LODs for vehicle.
Lod 0, 1, 2 screen size : screen size of LOD.
Note
Wheel sharing is useful for using the same wheel model for all wheels to reduce drawcalls.
Info Tab
Prefab Info
Car Info
Prefab : reference to source prefab.
Name : user’s name of the vehicle.
ID : new ID entry for vehicle collection.
Traffic group : traffic group of the vehicle.
- Override entity typenew entity type for selected vehicle (might be useful for specific vehicles such as tram).
Entity type
- Public transporton/off public transport feature. (Settings)
Predefined road
Capacity
Entries
- Settings type:
New : user-defined settings.
Template : vehicle settings are copied from the selected template [custom physics vehicle only].
Clone model : vehicle settings are copied from the selected CarModel in the list.
Wheel radius : wheel radius. (can be unique value)
Wheel offset : wheel offset by Y-axis of the vehicle. (can be unique value)
Suspension length : suspension length of the vehicle. (can be unique value) [Custom physics vehicles only]