We may earn an affiliate commission when you visit our partners.
Course image
MrM Programming

In this course, we’re going to be making a 3D physics-based 8-ball pool game using Unity. With that said, the ultimate goal of this course is not to show you how to make an eight-ball pool game per se, the ultimate goal is to use it to help you learn the basic principles of game-making in Unity that will enable you to create your own games.

One of the prominent features of our game is a real-life physics simulation.

Read more

In this course, we’re going to be making a 3D physics-based 8-ball pool game using Unity. With that said, the ultimate goal of this course is not to show you how to make an eight-ball pool game per se, the ultimate goal is to use it to help you learn the basic principles of game-making in Unity that will enable you to create your own games.

One of the prominent features of our game is a real-life physics simulation.

In other words, in the game that we will be making in this course, the player will be able to make jump shots, that make the ball bounce off the table; and swerve shots, that make the ball move in a curve.

Another distinct feature of our game is a pretty hard-to-beat AI player. What’s important about the AI part is that while working on it, you will learn how to code complex data-driven game logic, which is a pretty valuable experience.

In this course we will not only show you how to just make a game in Unity but we will show you how to make a publishable mobile game. The eight-ball pool game that we will use as an example in this course has been published on both Apple’s App Store  and Google’s Play Market and we will be making this game with an ultimate publishing goal in mind so that you can get the full experience.

And finally, since we aim to show you how to make a publishable game, we will also show you how to incorporate basic monetization by integrating ads into our project.

Alright, again, in this course, we’re using eight-ball pool as a learning example, to teach you transferrable skills that you can apply to any other game that you might want to make.

In order to achieve that, we provide what I like to think of as exhaustive explanation, while in reality, for some of you, it might be exhausting explanation. Therefore, the first chapters of this course have two versions of the same lesson, one with detailed explanation, and one with very little explanation.

We call them the Fast Track and the Learning Track lessons. So if you already have some experience with Unity, you might want to go for the Fast Track lessons, and switch to the Learning Track when you feel like you might need additional explanation.

Another feature of this course is based on the idea that learning is never a straight path, meaning quite often when we bump into something new, we cannot fully comprehend it as it requires additional knowledge and practice to become fully palatable.

So, throughout the entire course, we will be guiding you back to the previous lessons and we encourage you to actually do so. To help you navigate through the course, we have Glossary that contains descriptions of important concepts that you need to know to feel more comfortable with Unity. The Glossary also contains a list of references where the concepts are being explained and applied. In addition to Glossary, in some lessons, we also provide links to our YouTube videos that can give you additional information related to the lesson

Now, this course is designed for people with no experience with Unity. Zero

However, if you’re new to programming in general and if you’re not familiar with object-oriented programming, we recommend that you check out our YouTube channel first.

The main reason why we’re not covering programming in general in this course is simply because Unity is not a good choice for that.

However, this doesn’t mean that this course is not a good fit if you’re completely new to programming. Just go over the videos that we have on our YouTube channel, and you will be fine.

Another feature of this course is the prototyping approach. Even though we’ve made and published the game before we started working on this course, we decided to show you a somewhat more natural process of game development where we start simple, with primitive graphics and simple functionality and expand our project throughout the course.

For example, instead of spending a lot of time perfecting the game controls or the UI, we first create a more primitive version and then polish them in smaller increments. And as we do that, we show you how to fix common bugs and address larger issues that arise when you expand your project.

We believe this approach is more beneficial for learning as the experiences you get in the process will enable you to address similar issues in other projects that you might be interested to be involved in in the future.

*Billiard Table Vectors by Vecteezy

Enroll now

What's inside

Syllabus

Introduction

In this video, we will explain why you might want to choose our course.

In this video, we will get started by downloading and installing Unity.

Read more

In this video, we will create a Unity project for our game. We will also start familiarizing ourselves with the interface of the Unity Editor. In addition, we will learn how to import and modify 3D assets in Unity; and work with materials. And we will do all that while setting up the pool table for our game.

In this video, we will create a Unity project for our game. We will also add a pool table asset to the project and set up its material.

In this video, we will set up the main camera for our game, and talk about how camera works in general. We will also talk in more detail about the Transform component, about Position, Rotation and Scale. In addition, we will talk about screen resolution and aspect ratio, which are very important concepts for game-making.

In this video, we will set up the main camera for our game.

In this video, we will continue talking about editing scenes in Unity. We will also introduce a new big concept, which is the Pivot Point. And we will do that while adding a cue stick to our project and adjusting its position and rotation relative to the cue ball.

In this video, we will add the cuestick to our game.

In this video, we will talk about game design in general, and the design of our specific game.

In this video, we will add code to our project, and we will start off by adding code that rotates the cuestick around the cueball on mouse drag, to allow the player to aim a shot.

In this video, we will do a bit of code refactoring, talk about caching, structs, enums and some other stuff. We will also learn about two types of coordinates spaces in Unity, namely Local space and Global space.

In this video, we will refactor that code to make it a bit less weird.

In this video, we will further modify our code to make the cuestick rotate on mouse drag. Specifically, we will have the cuestick rotate clock wise when we drag the mouse to the right or down; and counter clock wise when we drag the mouse left or up.

In this vides we will do a bit more of refactoring by splitting the code we have into two parts. We will also talk a bit about software design and architecture, specifically about some principles of organizing code.

In this video, we will write the elevation controller; and we will have the cuestick object change its elevation in the scene as we adjust it using the controller.

In this lesson, we will add a slider that will allow the player to adjust strike power and hit the cueball with the cuestick. We will also talk about Unity’s UI system and using interfaces in C#.

In this lesson, we will add a slider that will allow the player to adjust strike power and hit the cueball with the cuestick.

In this video, we will add colliders to the table and the cueball in order to enable Physics behavior.

In this video, we will connect the game logic to the rest of the game using game events.

In this video, we will write code to make the cueball move when we strike it with the cuestick.

In this video, we will tweak the Physics Engine settings to make the cueball bounce off the rails.

In this video, we will write code for the spin controller and have the physics engine apply spin to the cueball based on the spin controller

Now that we have some basic physics, we’re gonna tweak the existing game controls and we will start from adjusting cuestick rotation.

In this video, we will add another ball, an object ball to test the physics of the ball-to-ball collision. In addition, we will add an aim line that will help us aim a shot; and also we will talk about materials and shaders.

In this video, we will continue expanding our UI, specifically, we will add functionality that will allow the player to reposition the cueball on the table.

In this lesson, we will fix a few issues related to the cuestick anchor object not having the same position as the cueball.

In this lesson, we’re gonna fix some issues related to repositioning the cueball

In this video, we will add additional UI elements that will allow the player to adjust the elevation angle for the cuestick and apply spin to the cueball.

In this video, we will do a bit more of UI programming to have the pop up panels for cuestick controls disappear under certain conditions.

In this video, we’re gonna continue working on applying spin to the cueball. We will also tweak some game controllers to make it easier for us to test the new features.

I this video, we will complete the functionality related to game logic and then we will fix some bugs in the game logic.

In this lesson, we will complete the cuestick elevation part of the game by enabling jump and swerve shots.

In this video, we will start working on racking object balls and then breaking the rack, specifically, we will replace some of the assets with new ones.

In this video we’re gonna make our game rack the object balls on the table.

In this video, we're going to move on to tweaking the breakshot to make it a bit less boring.

In this video, we will do some visual polishing to make our game a little comfortable to play.

In this video, we’re gonna continue polishing our game to make it easier to aim a shot.

In this video, we're going to make sure our game supports various screen resolutions.

In this video, we will add a touch controller to our game to be able to test it on an actual mobile device.

In this video, we will build our game to an Android device to test it.

In this video, we will build our game to an iOS device to test it.

In this video, we will start working on the game logic for our game.

In this video, we will outline the logic of the Breakshot phase by making a flowchart diagram.

In this video, we will continue writing code for the game logic.

In this video, we will complete the part of the game logic responsible for handling the fouls that happen while the balls are in motion.

In this video, we will complete the part of the game logic responsible for handling the fouls that should get checked for once all the balls have stopped moving.

I this video, we will expand our UI to make it more informative and we will update the looks of the existing UI elements to make them look prettier.

In this video, we will write code for the turn indicator that we have in the top part of the screen.

In this video, we will write code for the ball displays that we have in the top panel.

In this video, we will write the message pop-up that we have in the bottom part of the screen.

In this video, we will fix a few bugs related to game logic.

In this video, we will add the cueball mover to improve player experience.

In this video, we will modify our aiming system to enable the player to aim at any point on the table.

In this video, we will tweak the behavior of the ghost ball to make aiming even more user-friendly.

In this video, we will add the game menu that will pop up on the menu button press.

In this video, we will make our game restart when the Restart button is pressed.

In this video, we will add a new scene and enable navigation between the two scenes.

In this video, we will add an audio player to play background music and have it persist across the scenes.

In this video, we will start adding sound effects to our game.

In this video, we will adjust the volume of the sound effects based on the collision speed.

In this video, we will add sound effects for special cases, such as break shot, and spin shot.

In this video, we will add three more sounds: a UI button click sound, a foul and a game over sound. We will also add a game over dialog box.

In this lesson, we will make the mute buttons work and we will save the mute settings so that they stay when we restart the game.

In this video, we will start working on the AI part of our game, by outlining the AI logic.

In this lesson, we will get to code writing and we will start from getting a list of pocketable balls for the AI Player.

In this lesson, we will write code the filter the list of pocketable balls to get a list of both pocketable and reachable ones.

In this lesson, we will write code to have the AI Player pick the ball to pocket.

In this video, we will write more code to enable the AI Player to make a shot and we will also handle some edge cases.

In this lesson, we will write code the enable our AI Player to handle the ball in hand case.

In this video, we will integrate the AI Player into our game.

In this video, we will complete the AI Player by fixing some bugs.

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Provides both 'Fast Track' and 'Learning Track' lessons, allowing learners with some Unity experience to skip ahead while beginners can take a more detailed approach
Covers building the game for both Android and iOS, providing practical experience in deploying to mobile platforms, which is essential for reaching a wider audience
Employs a prototyping approach, starting with simple graphics and functionality, which mirrors a natural game development process and helps learners address issues incrementally
Includes integrating ads for basic monetization, offering insights into publishing a mobile game and generating revenue, which is a valuable skill for indie developers
Explores complex data-driven game logic while developing the AI player, offering valuable experience in coding sophisticated game mechanics, which is applicable to various game genres
Recommends learners new to programming to check out their YouTube channel first, suggesting that some familiarity with object-oriented programming will be helpful for this course

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Building a pool game in unity

According to learners, this course provides a solid foundation in Unity game development by walking through the creation of a complete 8-ball pool game. Many found the hands-on project approach particularly effective for learning. Students appreciated the coverage of diverse topics, including realistic physics, building a basic AI player, and even steps for mobile publishing and monetization. While some learners with prior programming experience found the optional Fast Track lessons helpful, others felt that a strong understanding of C# and OOP was more critical than indicated for beginners, sometimes making the complex game logic challenging to grasp. Overall, it is considered a practical guide to creating a mobile game in Unity, though some parts may require supplementary programming knowledge.
Learn realistic game dev workflow.
"Showing how to build a basic version and then polish it felt like a very realistic way to develop games."
"Liked the prototyping method; it taught me how to iterate and fix issues as the project grew."
"Developing the game iteratively helped demystify the process and made it feel less overwhelming."
Develop complex data-driven game logic.
"The section on building the AI player was fascinating, showing how to make decisions based on game state."
"Learning the logic behind a computer opponent was challenging but rewarding."
"I found the AI part a bit complex, but it definitely pushed my coding skills."
"The AI logic was well-explained step-by-step, even if implementing it required focus."
Focus on realistic physics for pool balls.
"The physics engine setup for the balls and table felt very realistic and was explained well."
"Understanding how to apply forces and manage collisions for the pool physics was a key takeaway."
"Getting the ball physics just right required some tweaking, but the course provided a solid starting point."
Skip detailed explanations if experienced.
"The Fast Track videos were perfect for quickly reviewing concepts I already knew in Unity."
"I appreciated having the option to choose between the detailed Learning Track and the quicker Fast Track."
"Great feature for those with some Unity experience who don't need every step explained in depth."
Covers physics, AI, UI, audio, mobile build.
"Was impressed by the range of topics covered - from physics and AI to even getting the game ready for app stores."
"I wanted a course that showed me how to build a full game, and this covered all the necessary parts, including UI and audio."
"Learning how to implement game physics and a simple AI opponent was particularly valuable for me."
"The inclusion of mobile building and monetization was a great bonus I wasn't expecting."
Learn by building a full, functional game.
"Building a complete pool game from scratch was an amazing way to learn Unity. It kept me engaged."
"I really liked that we built a single, polished project throughout the course instead of disconnected examples."
"Creating an actual game made the concepts stick better than just theoretical lessons."
"The project-based learning made it much easier to see how all the different parts of Unity fit together."
Requires solid programming foundation.
"While it says zero Unity experience needed, a strong C# and OOP background is definitely necessary."
"As a complete beginner to programming, I struggled to keep up with the coding sections, especially the AI."
"The course pace is good if you understand programming concepts well, but challenging otherwise."
"I recommend having a solid grasp of C# before starting this course to fully benefit."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Making an AI Eight-Ball Pool Game in Unity with these activities:
Review Unity Physics Engine Fundamentals
Reinforce your understanding of the Unity Physics Engine before diving into the course. This will help you grasp the concepts of collision, forces, and movement used in the pool game.
Browse courses on Physics Engine
Show steps
  • Read the Unity documentation on the Physics Engine.
  • Watch introductory tutorials on Rigidbody and Colliders.
  • Create a simple scene with basic physics interactions.
Brush up on C# Scripting Basics
Strengthen your C# scripting skills to better understand and modify the game's code. This will make it easier to follow along with the course and implement your own features.
Browse courses on C# Scripting
Show steps
  • Review C# syntax and data types.
  • Practice writing simple scripts in Unity.
  • Familiarize yourself with Unity's API for game objects and components.
Review 'Unity in Action, Third Edition'
Supplement your learning with a comprehensive Unity guide. This book will provide a broader understanding of Unity concepts and techniques used in the course.
Show steps
  • Read chapters related to physics, UI, and game logic.
  • Experiment with the code examples provided in the book.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Follow Unity's 'Roll-a-ball' Tutorial
Gain hands-on experience with Unity's basic concepts by completing the 'Roll-a-ball' tutorial. This will reinforce your understanding of movement, collision, and camera control.
Show steps
  • Complete the official Unity 'Roll-a-ball' tutorial.
  • Modify the tutorial to add new features or mechanics.
Simple Physics Experimentation Project
Solidify your understanding of Unity physics by creating a small project focused solely on physics interactions. This will allow you to experiment with different settings and behaviors.
Show steps
  • Create a new Unity project.
  • Implement various physics interactions (e.g., bouncing, sliding, rolling).
  • Adjust physics settings to achieve desired effects.
Document Your AI Implementation
Deepen your understanding of the AI system by documenting its design and implementation. This will help you clarify your thoughts and identify areas for improvement.
Show steps
  • Create a document outlining the AI's decision-making process.
  • Explain the code used to implement the AI's logic.
  • Identify potential improvements or optimizations for the AI.
Contribute to a Unity Asset
Enhance your skills by contributing to an open-source Unity asset related to physics or AI. This will expose you to real-world development practices and collaboration.
Show steps
  • Find an open-source Unity asset on GitHub or GitLab.
  • Identify a bug or feature to work on.
  • Submit a pull request with your changes.

Career center

Learners who complete Making an AI Eight-Ball Pool Game in Unity will develop knowledge and skills that may be useful to these careers:
Unity Developer
A Unity Developer is a software engineer who specializes in using the Unity game engine to create interactive experiences, including games and simulations. This career works on all aspects of game development, from coding game mechanics to implementing user interfaces. This course emphasizes the basic principles of game making in Unity. For someone interested in becoming a Unity Developer, this course stands out due to its focus on creating a complete, publishable game, including considerations for monetization, and deploying to multiple mobile platforms.
Game Developer
A Game Developer designs and codes video games for various platforms. Creating an eight-ball pool game in Unity, as covered in this course, provides a solid foundation for understanding game development principles. This role designs gameplay mechanics, implements user interfaces, and optimizes game performance. A course like this, which focuses on creating a publishable mobile game, is invaluable for understanding the full lifecycle of game development. Specifically, the lessons on adding game controls, implementing physics, and building for both Android and iOS platforms are directly applicable to the daily tasks of a Game Developer.
Indie Game Developer
An Indie Game Developer works independently or in a small team to create and publish their own games. This role generally requires a broad skill set, including game design, programming, art, and marketing. This course is particularly beneficial as it walks through every stage needed to make a game. The course’s emphasis on making a publishable mobile game, including monetization and deployment, provides a comprehensive overview of the skills needed to succeed as an Indie Game Developer.
Mobile Game Developer
A Mobile Game Developer focuses on creating games specifically for mobile devices, such as smartphones and tablets. This career specializes in optimizing games for touch screen interfaces and varying hardware capabilities. The fact that this course emphasizes making a publishable mobile game makes it directly applicable to this career. The course covers building the game for both Android and iOS, incorporating monetization through ads, and adapting the game for various screen resolutions. These are all critical skills for a Mobile Game Developer.
Game Designer
A Game Designer conceptualizes and designs the gameplay, rules, and story of a video game. This career works on defining the player experience and creating engaging challenges. Making an AI eight-ball pool game in Unity involves careful consideration of game design principles, such as balancing difficulty, creating intuitive controls, and providing a satisfying user experience. The game design aspects covered in the course, such as adding game controls, implementing physics, and designing the AI player, are essential skills for any Game Designer.
Gameplay Programmer
A Gameplay Programmer focuses on implementing the interactive elements of a game, such as character movement, combat systems, and puzzle mechanics. This role works closely with game designers to bring their visions to life, translating design documents into functional code. Since this course focuses on creating a fully functional game with interactive elements and real time physics, those interested may find it directly applicable to their career path. Specifically adding game controls, implementing physics and working with complex game logic could be helpful.
Physics Programmer
A Physics Programmer is a specialized role within game development that focuses on creating realistic and engaging physics simulations. This role involves implementing collision detection, rigid body dynamics, and other physical behaviors within the game engine. Considering this course focuses on creating a 3d physics based pool game using Unity, you may find it very helpful. The course's lessons on adding colliders, tweaking physics engine settings, and applying spin to the cue ball are all directly relevant to the responsibilities of a Physics Programmer.
UI Programmer
A User Interface Programmer is responsible for coding the interactive elements that players use to navigate and control a game. The UI programmer focuses on integrating user interfaces. This course may be quite useful as it covers Unity’s UI system. It also covers adding elements that allow the user to adjust strike power and apply spin to the cueball. Additionally, the course addresses improving the user experience by modifying the aiming system and adding a cueball mover.
Technical Artist
A Technical Artist bridges the gap between artists and programmers, ensuring that art assets work seamlessly within a game engine. This career optimizes assets, creates shaders, and develops tools for artists to use. The course's coverage of importing and modifying 3D assets, working with materials, and adjusting visuals to support various screen resolutions is highly relevant to the responsibilities of a Technical Artist. The focus on visual polishing and UI improvements throughout helps hone skills in creating visually appealing and performant games.
Simulation Developer
A Simulation Developer creates software that models real-world systems or processes. This role requires a strong understanding of physics, mathematics, and programming. Since the course involves creating a 3D physics based game, it helps build a foundation in simulating physical interactions. Specifically, the lessons on adding colliders, tweaking physics engine settings, and applying spin to the cue ball are all directly applicable to simulating real-world physics in software.
AI Programmer
An AI Programmer specializes in developing the artificial intelligence that drives characters and systems within a game. This career involves designing algorithms that allow non-player characters to make decisions and react to the game environment. If this is a role that appeals you, this course may be useful because it specifically covers how to code complex, data driven game logic for an AI player in the pool game. The prototyping approach emphasized throughout the course can help one learn how to address issues that arise when developing AI in games. These include areas such as making sure the AI pockets the ball.
Software Engineer
A Software Engineer designs, develops, and tests software applications. The skills learned in this course, such as coding in C#, working with game engines like Unity, and applying object-oriented programming principles, are transferable to many software engineering roles. Creating a fully functional game, as taught in the course, involves problem-solving, algorithm design, and software architecture, all of which are valuable skills for a Software Engineer. Moreover, the emphasis on code refactoring and software design helps build a foundation for larger-scale projects.
Virtual Reality Developer
A Virtual Reality Developer creates immersive experiences for VR headsets. These software engineers design and develop interactive virtual environments. This role leverages skills in 3D modeling, spatial audio, and user interface design to create compelling VR applications. Since Unity is frequently used in Virtual Reality development, this course may be helpful as it walks through every stage needed to make a game in Unity. Gaining experience on the fundamentals may be useful for a virtual reality developer.
Augmented Reality Developer
An Augmented Reality Developer creates interactive experiences that overlay digital content onto the real world through devices like smartphones and tablets. The Unity game engine is frequently used in Augmented Reality development, as it allows programmers to build AR applications. The lessons about setting up the camera and importing assets can be helpful. Also this course emphasizes mobile deployment, which is very important.
Game Engine Developer
A Game Engine Developer works on the underlying software that powers video games. This role involves developing and maintaining the core systems of a game engine, such as rendering, physics, and scripting. This career typically requires an advanced degree, such as a Master's or PhD in Computer Science or a related field. While this course focuses on using Unity rather than developing a game engine from scratch, the knowledge gained can be useful to know. Understanding how features such as physics are implemented can be helpful.

Reading list

We've selected one books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Making an AI Eight-Ball Pool Game in Unity.
Provides a comprehensive guide to Unity development, covering topics from basic scripting to advanced game mechanics. It's a useful reference for understanding the underlying principles of game development in Unity. While not strictly necessary for the course, it offers a deeper dive into the concepts covered and can be valuable for those looking to expand their knowledge. It is commonly used as a textbook at academic institutions.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser