Racing Car Game # Day 5— Wheel Smoke Effect

In the previous article, Racing Car Game # Day 4 — Braking & Skidding, we added Braking, skid marks, and skid sound effects. In this article, we will enhance it with a wheel smoking effect.

First, we need to add a Particle System and name it WheelSmoke.

Change following settings

In the Transform, rotate the X: to -180

On the Particle System:

  • Start Lifetime Random BetweenTwo Constants 2 and 7
  • Start Speed Random BetweenTwo Constants 2 and 4
  • Start Size Random Between Two Constants 2 and 3
  • Gravity Modifier -0.02
  • Simulation Space World
  • Max Particles 500

Emission

  • Rate over Time 20

Shape

  • Shape Cone
  • Angle 5
  • Radius 0.1

Color over Lifetime

I made the left side a little grey, full Alpha and right side white but alpha set zero so the particle fades away

Size over Lifetime

I change the curve to smooth out and increase the size from 1 to 5

Make it a prefab and remove it from the Hierarchy. Let’s open the Locomotion script to create the smoke on the tyres when skidding.

First, add a variable to store the prefab at the top.

We need an array to hold a particle system for each wheel.

In the Awake method, we want to create and have the wheel smoke ready

In the CheckSkid method, add the following to the bottom of the if statement

Save the script, back in the Editor, select the car and drag on the WheelSmoke prefab to the Locomotion slot.

Press play and enjoy the effect. Go ahead and play around with settings to get the right look of smoke.

In the next article, we are going to migrate to the next input system so we can play the game on either a keyboard, gamepad, or touch screen.

If you enjoyed reading this article give me a Clap, also if you would like to see more, “Follow” me, so you may be notified of future releases. You may also send me a message if you need any help or if there is something you think I can improve.

A Data & Analytics Consultant who is expanding into developing experiences in XR, Enterprise and Gaming space using Unity www.jeannoelseneque.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to use country-specific keyboards with Linux

Goodbye Jenkins (Part 2): Give Flight to your CD with Drone Control

Heart of PHP — An issue for beginners

What preferred programming language can tell about me

Install Hadoop on MacOS

The mythology of Migration of Monolithic to the Clouds

Automate Your Scripts In 3 Steps

Automate Your Python Scripts In 3 Steps — Windows and Mac

Building high-quality software

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jean-Noel Seneque

Jean-Noel Seneque

A Data & Analytics Consultant who is expanding into developing experiences in XR, Enterprise and Gaming space using Unity www.jeannoelseneque.com

More from Medium

Racing Car Game # Day 3 — Steering

Adding Post-Processing Profiles in Unity

Realtime, Mixed and Baked Light Modes — For Static & Dynamic Game Objects in Unity

Racing Car Game # Day 6— New Unity Input System