Controls all the vehicle effects.
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.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.
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.