Effect system makes use of VehicleComponents and therefore each Effect
can be turned on or off, be enabled or disable or have LOD set.
Effect
s with manager in the name manage multiple instances of the effect, usually one for each wheel - e.g. skidmarks or surface particles.
ExhaustFlash
Effect
is used to imitate flames shooting out of exhaust. The method to achieve this is identical to the one used for most muzzle flash in FPS games; that is a set of images gets enabled and disabled at rapid rate with different sprite and scale each time. This is a performant way to achieve the effect while avoiding particle effects.
Quad
s perpendicular to each other. Move them to the location of the exhaust.Quad
s.Particles/Standard Unlit
(Unity 2019) or equivalent shader with Transparent
rendering and Multiply
color mode. The included example on Sports Car prefab can be copied. Assigning one of the included flame textures will show if the rotation of the Quad
is correct. Rotate Quad
if needed.MeshRenderer
s from the newly created Quads to the ExhaustFlash
⇒ Mesh Renderers
list.To make flames look more convincing a random texture is assigned to each Quad on each flash. A number of default textures is included.
Flash Textures
list.
ExhaustSmoke
controls exhaust ParticleSystem
color, size and emission speed. It interpolates between NormalColor
and SootColor
based on engine state.
ParticleSystem
s at vehicle exhaust position. Prefab of pre-configured ParticleSystem
comes with the asset (Effects > Particles > Prefabs).ParticleSystem
s to the Particle Systems
list inside ExhaustSmoke
inspector.
LightsManager
is tasked with turning VehicleLight
s on or off depending on user input.
VehicleLight
is a collection of LightSource
s. When the light is turned on all LightSources
are turned on and vice versa.
One vehicle light source. Can be a Light
or emissive Mesh
.
Light
is selected as Type
any Unity Light
can be assigned. It will be turned on and off according to user input.Mesh
is selected as Type
any Mesh
with Standard
shader can be used. It's Emission
field will be toggled to imitate a working light. Since this does not emit enough light to be a headlight usually another light source is used in tandem, this one with SpotLight
assigned.
For an emissive mesh light to work it needs to be a separate object. If the model does not come with lights and blinkers as separate objects these will need to be separated in 3D modelling software such as Blender (free, open source).
When using Mesh
light source make sure to tick the Emission
checkbox on the material. This lets Unity know that this variant of the material is in use and should be included in the build.
Skidmarks are generated when wheel skids / slips over a surface.
Max Marks Per Section * 2
. Min Distance
is the distance a wheel needs to travel before a new mark is created.Max Marks Per Section
- similar to the old snake game. To make this transition smooth Fade Over Distance
can be enabled or Peristent Skidmarks
can be used. Check the section below for more info.GrounOffset
needs to be increased.Longitudinal Slip Threshold
and Lateral Slip Threshold
from vehicle settings tab are used.SurfacePreset
to get the settings for the current surface type.Max Marks Per Section
size.Peristent Skidmark Destroy Distance
.
SurfaceParticleManager
creates and manages particles based on current SurfacePreset
settings.
ParticleSystems
.Lateral Slip Threshold
and Longitudinal Slip Threshold
under Settings tab determine the lowest wheel slip threshold needed for wheel to be considered to be slipping. This affects particle effects.
Mirrors are set up through a combination of Camera
s, RenderTexture
s and Material
s with specific UV mapping.
Camera first renders its view to a RenderTexture
which is assigned to a Material
(any shader that supports albedo map will work). This Material
has an UV map that corresponds to the surface of the vehicle mirror.
Possible setups are:
Camera
to a separate RenderTexture
which is assigned to a separate Material
. Best visual quality but slow.
This guide will demonstrate how to set up mirrors on a vehicle using Blender.