hey, welcome to mix and jam Patel about game development. Experimentation today’s. Project is inspired by mario kart in the game. You can drift your vehicle to slide around more precisely the more your drift, the more boost power.
You get. My goal for this project is to try and build a similar drifting system with particles and effects using unity. So here are the steps I needed to follow for the recreation, create a simple card controller to use as a base for the mechanic work on the drifting ability itself and at the spark particles and extra effects to build the controller.
I was inspired by this arcade like car system made by Kenny. If you don’t know them yet Kenny creates tons of free assets for you to use on your projects, so I definitely think you should check it out.
They explain on this tweak. The car controller was made using the giant rolling sphere that detects collisions and gets forced based on the car model direction. So I replicated that by creating a cube and a sphere Collider with the rigidbody in my script, I can rotate the cube and add force the spheres rigidbody based on the cubes for direction.
I also made the cube rotate relative to the ground normal by omitting the raycast below it. Then I downloaded a 3d model of a cart by this user on sketchfab and replaced the old Cube with it. I also added a camera that follows and looks at the car to create the same perspective as the game to work on the drift mechanic.
I made a boolean on my script called drifting that was activated with the press of a button. I also made an integer to store the direction of the drift when the button is pressed while a drifting, the script constantly makes the card steer in the proper direction.
The main difference is that in the game, the player can modify the amount of steering, depending on the horizontal axis input. I replicated that by creating a multiplier for the steering amount. That amount is based on the horizontal axis, but the horizontal axis goes from minus 1 to 1, so I had to remap those values to instead go from 0 to 2.
In that way, the input from the player can determine the drift amount. I started working on the particles for the drift. The first particle system was a simple loop emission with no velocity. The second one was a burst of particles.
They used the gravity modifier and had the render mode set to stretched fill board. The third one is similar to the second who, with the bigger length scale and with the trail properly activated in the game, the particles change color to represent the power of the boost that will be gained.
So in my script, while the player is drifting, I accumulate a property called drift power that was responsible for changing the colors of the particles. Then I added extra particles for when there’s, a color change and some more for the final turbo, [ Music ].
To finish things off, I downloaded this racing kit from Kenny and made a track using those 3d models. I also added some post-processing, like blue and F a field to make the boost. Have this speed sensation, I changed the amount of chromatic aberration when the turbo is happening and after a bit of adjustments, this is how it turned out [, Music ].
As always, you can find the link for the project’s. Repository on the description below mixing Jam is only possible because of everyone that’s, helping out on patreon, including these top-tier supporters.
So if you enjoy the channel, don’t forget to subscribe to check out the future projects. Thanks for watching and I’ll see you in the next one: [ Music, ], [, Music, ]