
Learn to build a Mario Kart style racing game in Unity six by coding racing karts, items, and three cartoony tracks with spline design and local 2-4 player multiplayer.
Install Unity Hub and Unity LTS, then create a project named Wacky Monster Carts. Open Package Manager to install Cinemachine, Input System, ProBuilder, Splines, and the samples to build roads.
Create a drive action map in Unity's input system with accelerate and brake, and steering as a vector2 from gamepad or keyboard arrows and wasd, then save the asset.
Build a sandbox driving scene with a player kart, input and action assets, wheel colliders, and a suspension-driven physics system, while Cinemachine cameras follow and orbit the car.
Implement a Unity input script to drive a car, exposing gas, brake, and steering (Vector2), and map gamepad and keyboard inputs for acceleration and steering.
Drive forward by applying acceleration via motor torque and braking via brake torque on wheel colliders, syncing wheel meshes, and adding downforce to stabilize the kart at speed.
Set a max steering angle of 30 degrees, pass the steering value to the drive function, and steer only the two front wheels via wheel colliders for responsive Unity steering.
Tune suspension with spring, damper, and target position to control bounce and stability, then implement brake assist in code to freeze rotation and prevent flips on flat surfaces.
Apply downforce only when the rear wheels are grounded, detect ground with wheel colliders, and freeze rigidbody rotation briefly via a coroutine to enable a stable glide off ramps.
Create a reverse input action named reverse, bind it to gamepad button north and keyboard R, toggle a reverse flag to switch thrust, and switch the Cinemachine camera to follow.
Add reset input in unity's input system to flip the kart back to its rotation. Bind to d-pad up and the t key, setting transform.rotation to a new quaternion 0000.
Create a cart sounds system in Unity with start, idle, driving, drift, and reverse audio sources; compute cart speed from rigidbody velocity and driving volume/pitch via lerp and sine oscillation.
Use the Unity input system to trigger brake to a stop and manage driving, drift, and reverse sound volumes as cart speed changes, while controlling rear tire smoke with script.
Toggle tail lights emission tied to brake input in a Unity Mario Kart style game, turning emission on when braking and off when released.
Enable drifting in a Mario Kart racing game in Unity by mapping drift input, adjusting rigidbody angular velocity, tweaking rear wheel friction curves, and adding drift sounds and smoke effects.
Add a UI speed display, convert cart velocity to mph, and implement a multi-gear system with torque thresholds to boost top speed, plus center-of-mass adjustments for stability.
Design a race track in Unity by creating a terrain, drawing splines into a smooth bezier road, widening the road, and placing a player car to test bends and speed.
Export the spline track as an FBX, align it to the original, add a mesh collider, and save as a reusable prefab in the splines folder.
Paint terrain grass texture, adjust tiling, raise terrain and spline track for alignment, replace skybox with cartoony cloud day, and create dirt road material with tiling and color DAB69E.
Create blocker colliders by turning a cube into a prefab and adjusting its box collider; use spline instantiate to place them along the track edges.
Add fences around track corners using a wood fence prefab with spline instantiate; adjust distance, bake instances, and ensure colliders block carts from leaving the curve.
Set up blockers as physical cubes with optimized colliders, adjust positions to avoid overlaps, and apply a bouncy physics material to fences so the cart bounces and stays on track.
Add interactive obstacles to a Mario Kart style track by placing statues and a totem pole, adjusting scale and colliders, and applying AI-generated asset overrides to create challenging tracks.
Build a log stomper in Unity by scaling and placing a desert tower prefab with a log, aligning it to the path, and converting to a ProBuilder mesh.
Replace the mesh collider with a box collider to reduce calculations, then place stumps along the track, adjust capsule colliders, and create an opening that forces carts to swerve.
Drag fir and LPW trees from prefabs into the scene, resize and remove colliders, then use spline instantiate with distances and percentages to bake and refine tree placement along track.
Delete the trees, instantiate a small rock with distance 72 and x offset, scale to 1.6, rotate Y 0–90, bake, and add cliff stones scaled to 11 to fill gaps.
Bake a lightmap in Unity by placing and configuring point lights, adjusting colors, and creating a light settings asset to achieve a cartoony, well-lit track.
Add a Wacky Monster to the cart, align its bones to sit on the chair, and set a cinemachine follow camera with tight damping for a fixed, closer view.
Place a point light above the cart, adjust range, intensity, and orange color to add highlights; use light layers to exclude the road, applying light layer one to cart meshes.
Duplicate the sample scene profile, apply changes to the original prefab, and tune bloom, white balance, and saturation to achieve a cartoony look while restoring shadows with light layers.
Attach an audio source to the cart, tag obstacles, and use an obstacle sounds script to play the fence hit sound on collision in a Mario Kart Unity 6 game.
Add and configure smoke particles to the log stomper prefab in Unity, adjusting scale, rotation, and emission, duplicating the effects, and ensuring they animate on contact with the ground.
Set up a 3D audio source with a bang sound for log stomper collisions, enable linear rolloff at 300 units, animate keyframes for smoke and sound, and apply to prefab.
Tag logs as splat, add box colliders, and trigger a splat sound on hit; squash the cart, pause physics, then reset and play the return sound.
In Unity, animate two totem poles by creating flame effects, adding 3D cubes with fire breath, audio sources, and triggers, then record keyframed rotations and timed fire on/off.
Attach smoke and fire particle effects to the cart, tune emission and size, then trigger an explosion with sound and engine stop when the cart collides with a totem pole.
Set up a simple AI car in Unity using a NavMesh agent and navmesh surface; bake a navmesh with obstacles like statue heads to steer the cart along the track.
Create AI waypoints along the spline track by placing waypoint cubes, instantiating four, and baking them under an empty parent to guide the kart along the entire track.
Create a ai control script using a navmesh agent to move a cart through waypoint targets, rotate wheels, and periodically check distance to switch targets.
Learn to implement AI kart audio in Unity by scripting cart sounds, controlling idle and driving audio with speed-driven volume and pitch, and tuning spatial blend.
Configure a 4x4 kart with a kinematic rigidbody and navmesh agent to support ai and player. Toggle is player, adjust speed, and handle OnTriggerEnter with splat to trigger obstacle sounds.
Implement kart spin outs in a Unity Mario Kart style game by tagging player and AI cars, triggering spins and spin sounds on collision, and using coroutines to reset rotation.
Place progress points along the race spline to track cart positions using trigger cube prefabs. Space and bake the points as a prefab to ensure correct progression.
Set the ai kart max speed and use a time.deltaTime change speed routine to accelerate to the max and decelerate around bends, with ontriggerenter driven progress points varying speed.
Implement AI response to collisions using an isHit flag to stop or resume the AI kart by adjusting agent speeds based on collisions with the player or obstacles.
Set up special item inputs using the input actions editor, adding left, right, and choose actions with gamepad and keyboard bindings, then save the asset.
Attach pre-animated boxing gloves to the 4x4 cart and drive them with a special-items script using the Unity input system. Include coroutine-driven deactivation and 3D cartoon sound effects.
Create a missile script with an explosion prefab that destroys the missile after eight seconds, briefly disables the collider, and fires from left and right spawn points at enemies.
Implement missile collision in Unity: detect missile tag in ontriggerenter, run missile hit coroutine to explode, squash the cart, pause, then resume engine and movement, and add 3D missile audio.
Create a cartoon bomb prefab with particle effects and a trigger box collider. Attach a bomb script that detonates after three seconds, spawning an explosion and an explosion sound.
Spawn a cartoon bomb on the cart with left and right spawn points, then instantiate it when the special item ID equals two in this Unity Mario Kart setup.
Configure input controls to reverse camera by binding a camera change action to dpad down or C key, then attach and toggle forward and reverse Cinemachine cameras on the cart.
Drag an oil splat prefab into the world and tag it as oil. Expand a trigger collider over time to create a growing oil slick that affects approaching carts.
Set up a spawn point for the AI cart and add a Special Items script to spawn bombs and oil spills at defined points with cooldowns.
Set up ai item spawns by removing bombs and oils, spreading spawn points to influence ai carts' speed, with three-count limits that decrement on spawn.
Modify the navmesh by adding obstacle prefabs along the spline track, using a navmesh modifier, and rebaking to carve barriers that keep the kart on the track.
Duplicate and tag ai karts for four players, raise check distance to 1.0, set start speed to 30, introduce a 45 max speed with random range, and support bombs.
Create a dedicated map camera and render texture to display a white glowing track map in the ui, anchored bottom-left on the canvas.
Create a red emitting player marker with a ProBuilder arrow shape, scale for visibility, and attach it to the 4x4 player so it follows the kart on the map.
Duplicate the player marker onto each AI cart, create a blue emission material, and apply it as an override on AI cart prefabs so every AI cart has its marker.
Display and customize the speed UI for a kart character by anchoring speed and mph text to the bottom left, adjusting fonts, colors, and alignment to reflect live speed changes.
Number each progress point automatically, manage a save progress script with progress amounts and current positions for seven carts, and update on trigger enter to ensure forward progression.
Link a ui text element to a script that updates every 0.2 seconds to show the player's race position (first to fourth) for the 4x4 cart in Unity.
Prevent players from driving backward and going the wrong way by flipping the cart to face forward using a change direction flag, 180-degree y rotation, and a reset coroutine.
Stop the ai cart on obstacle impact by setting the cart agent to stopped, keeping it static, then reset speed to 25 and clear the stop to resume driving.
Implement a lap counter in a Mario Kart style Unity game by handling start line resets, lap progression, and updating a canvas display.
Set bomb ready and oil ready as integers with a random range between 0 and 2 to yield 0 or 1, enabling a 50/50 drop.
Bind a public image and sprite array in Unity to display the current special item, cycling from boxing glove to missile, bomb, and oil slick.
Set up UI legacy text to show remaining special item amounts (boxing glove, missiles, bombs, oil spills) and implement a save-progress update that decrements and displays the current item amount.
Set up the race start with looping two-dimensional track music and a track canvas showing a start text and the frantic forest title, gating ai until start.
Create an opening cinematic in Unity by aligning three cameras to key shots and sequencing them with a timeline and activation tracks.
This lecture shows setting up a race start sequence in Unity 6, including a player spawn point, start countdown, camera switching, and enabling racer movement.
Finish a Mario kart style race in Unity 6 by managing timeline camera switches, saving progress on the final lap, and loading the winners scene after a short finish animation.
Create a finish UI overlay in Unity to display your position number and the winner, wiring text fields and a coroutine to reveal the winner when the race ends.
Add drift-aware steering with a drifting flag and normalized input for instant max steering when drifting. Freeze Y position, raise player marker above AI markers, and adjust bomb spawn rotation.
Create a main menu scene in Unity with a URP canvas scaled to 1920 by 1080, add background image, and single player, multiplayer, and exit buttons with native sizes.
Switch the camera background to a solid color, then assemble the kart choose menu with title and name fields, navigation buttons, and a rotating cart display controlled by a script.
Create a persistent save object to keep single or multiplayer mode, cart selection, and player name across scenes, and build a menu that rotates carts and switches canvases with audio.
Cycle through kart selections in Unity by enabling the chosen cart, updating its name, and disabling navigation buttons at the ends. Implement next and back button logic and canvas switching.
Configure the menu choose button to save player one cart and name, then load the next scene in Unity, and add a looping casual game music track to the menu.
Set up and replace all player prefabs in Unity by unpacking, tagging as player one, wiring cameras, canvas, and scripts, then copy components across five carts for consistency.
Set up a racetrack selection scene with a ui canvas, three track buttons using sprite swaps, and explicit navigation tied to a first selected for gamepad and keyboard use.
Create a public static track index and track selection script using scene management to load the chosen track. Wire UI buttons to set the index and load scenes in order.
Create a maps script in Unity to dynamically update the UI map image for each track using a render texture array, aligning scenes and tracks.
Add a loading text to the canvas using oregano font, large red 'loading...'; toggle it on during scene load and wire the race button, race text, and loading text.
Modify the race start script to use a public array of carts, instantiate the selected cart at the spawn point, and ensure players appear in the correct order for testing.
Convert a player kart into an AI cart by unpacking the prefab, removing player input, and renaming it; then copy components and assign correct wheels, sounds, and an AI marker.
Set and order waypoints using tags, create and arrange AI spawn points, modify the AI kart control and race start scripts to spawn unique AI karts at correct points.
Assign unique AI tags to all carts, adding A4 and A5, and update obstacle sound, progress point, and save progress scripts for nine carts.
Add a pause menu by binding pause to gamepad start and keyboard escape, building a pause canvas, and toggling time scale to pause or resume, returning to the main menu.
Implement a finish ui with a menu button to return to the main menu, using a sprite swap and onclick to load the winners scene; reset time.timeScale to 1.0.
copy pre-made track elements, paste into the snow showdown scene, adjust the width, and configure spawn points, timeline, and progress points to enable a race with AI, bombs, and oil.
Welcome to my new course where we will be Making a Mario Kart style racing game in Unity 6.
I will take you step by step through the process of creating a complete game from start to finish.
Beginner to Intermediate level coding
We write our own code throughout the game and look in detail at writing code specifically for racing cars and karts. This also covers computer controlled AI karts that challenge you to a competitive race.
What we create
The course features three cartoony race tracks. The first track we create ourselves from scratch, covering track design using Unity splines. Asset layout and animated obstacles.
The karts have special items such as boxing gloves so you can punch the opponents out of the way when they are too close. Missiles so you can blow up karts that are up ahead of you. Cartoon bombs that can blow up karts behind you and oil splats that will cause opponents to spin out and lose control.
Single player and local multiplayer
We use the Unity Input System, so you can control the kart using keyboard and mouse, or gamepad. We create a local multiplayer mode for 2, 3 or 4 local players. Note that this isn't online multiplayer, but local multiplayer where up to 4 players can use the same computer to race against each other.
Develop game design and coding skills
By the end of this course you will have developed skills and knowledge to make your own awesome driving games and have a completed game for your portfolio of work. The end product is yours and you can share it with friends or even upload online.
You don't need any previous game design experience as I take you through it step by step. You can of course continue to add your own ideas, tracks, cars and assets to this project. If you get stuck just drop me a message in the Q & A section and I'll help you get everything sorted.
Why not enrol today and I look forward to seeing you in the course.