Create a Virtual Pet Game with Unity and C#

Build a Classic Virtual Pet Game for Mobile Devices using Unity and C#

What's Inside

In this course, you will learn how to build a classic Virtual Pet Game for mobile devices with Unity and C#.

We'll create:

- an animated character,
- progress bars to display the needs of our pet,
- a simple in-game shop with scrollable content,
- a custom mini game,

... and so on.

You will gain access to all the C# scripts that are used to build this game right in the beginning of the course, but we will take a closer look at each of the scripts before we use them.

This approach will help us save a lot of time instead of typing in the code manually and it will let us build a more interesting and complicated game. Among all the scripts provided with this course you will get a free asset to create sliding menus in any of your future projects.

I have tried to save the project that I was working in as often as I can so that you can easily pick up the material from any point in this course. All these projects and the assets used to develop our example application will be available for download with this course.

The material in this course is divided into 5 Sections.

Section 1 includes a short overview of the project that we will be making in this course.

In Section 2, we will create a basis that is used for any virtual pet game – a system that will constantly demand care from our players in different categories. In this game, we will have categories for food, sleep, taking our pet for a walk, and playing with our pet. We will make custom progress bars to display our pet's current needs. In all the other Sections of this course, we will come up with different methods of interacting with our Care system to restore care points.

In Section 3, I will show you how to create sliding menus using a free asset provided with this course. We will learn how to lay our pet to sleep to restore his Sleep care points. And we will create an in-game shop with scrollable content that will allow us to buy food items for our pet. Eating these food items will restore his Food care points.

In Section 4, we will focus on animating our pet character. We will try to make the most out of the art assets that we have to create an interesting character with diverse behaviors. You will learn how to manage complex state machines in Unity's built-in Animator component. We will discuss grouping animations by creating sub-state machines. We will give our character an ability to move in the scene. This is not used in every virtual pet game, but we will later need this feature for our mini game. We will add a new Training system to our game that will allow our players to give commands to our pet (sit, bark, look around – based on the animations that are available for this character)

In Section 5, we will add 3 new scenes to our project: a starting scene, a game over scene, and a scene to take our pet for a walk and play our mini game. We will create a fun mini game that will let our players get our in-game currency to buy more items from the shop. We will add a speech bubble for our pet to send some messages when he needs something from our players. In this Section, we will make our Health HUD functional. If the health of our pet drops to 0 or below the game will end.

By the end of this course, we will end up with a fully functional virtual pet game.

In the last lecture, I will build this game and show you how it looks and feels on an actual mobile device.

BONUS

Among all the scripts provided with this course, you will get a free asset to create sliding menus in any of your future projects.

Typically, an asset of this quality would sell for $25 or more in the Unity asset store.

This asset is designed to work with new Unity UI. It will help you slide any of your UI game objects in and out of view from any direction (Top, Bottom, Left, Right) into any area of your screen. There is no need to create and configure Mecanim animations to control the movement of your sliding menus. Everything is controlled by a single script component.

Sliding menus created with this asset will support all the Unity UI features and automatically resize itself to fit their sliding area on different devices with different screens and aspect ratios.

And this comes with the course for free!

What are the requirements?

  • I try to explain everything as much as I possibly can, but this is quite a complex application, so it is recommended that you have at least some previous experience with C#.
  • But it is not strictly necessary because you will still get a full Unity project of this game and all the scripts are pre-made and available right from the start of this course.
  • I mostly do not use any advanced features of C# language in this course. In some of the scripts I use properties and coroutines, but we will discuss how they work.
  • You should install Unity3d to develop the application that we are making in this course. Any version after Unity 5 will do.

What am I going to get from this course?

  • Build a complete Virtual Pet game for mobile devices from scratch with Unity and C#
  • Create a system that will constantly demand care from players in certain categories (in this game - Food, Sleep, Fun, Walk)
  • Come up with a creative and unique way to refill care points for each of these categories
  • Create progress bars, sliding menus, scrollable lists in Unity
  • Create a simple mini game (catch a falling object)
  • Create an in-game shop to sell different items or power-ups to your players.
  • Set up a Unity project with multiple scenes
  • You will learn a lot about saving information between scenes and between game launches
  • You will learn how to use properties, coroutines, singleton pattern in C#
  • Use Layout groups to organize your user interfaces
  • Create animated sprite-based characters in Unity
  • Manage complex Animator state machines to transition between animation states of your characters
  • Improve your C# scripting skills by viewing simple and easy to understand examples from this course
  • You will get a fully functional Unity project of the application created in this tutorial

What is the target audience?

  • This course is for people who want to build their own mobile Virtual Pet game with Unity absolutely from scratch. The techniques taught in this course are universal and applicable for any Virtual Pet game.
  • This course is also useful because it gives you an insight into the step by step development of a complete Unity game project from start to finish.

What are people saying about the course?

Explains everything very clearly so that a novice can understand it. Thanks! -Matt
This is a great course to learn about Care Systems! The one in this course is used to develop a virtual pet game, but with a few tweaks it can be applied to all sorts of games. In other words, even though the course merely claims to teach you how to create a virtual pet game, it also sets a milestone towards other projects you might have in mind! Highly recommended! -Roberto

This is a wonderful course. The instructor has a pleasant voice and clearly knows his stuff. There are a ton of useful scripts to learn from and great scope for those who enjoy jigging code to come up with interesting variations of the theme. Sprites are available for Pets within the project. -Grant

Nikola This course showed the process of creating a complete "Pet game" project using Unity Personal Edition & MonoDevelop. All the steps needed to import external files into the Unity project are shown, which was useful as it is easy to get lost in the process when starting out. The instructor also provides advice about pixel art and the various settings available in Unity. I also learned a bit about sprites and how they are cut. All of the videos are very consistent and in a similar format which makes following the course easier. The instructor also provides downloadable code that was saved at various stages of the project, so it is easy to set up the code at any point during the course. -Nikola

I was searching online for a good Unity course and was referred to this by a friend. So far it has been a great learning experience. -Vaishakh

The course is excellently organised and completely practice-oriented, which to me is very useful. The lecturer explains each detail very clearly. Although I had no knowledge of Unity prior to the course, now that I took the course, I feel that I have already grasped the basics of Unity. Will definitely take more courses about Unity from this lecturer, in order to elaborate on my knowledge of the platform. -Ivaylo

Course Curriculum

Get started now!



Certificate Available
265+ Students
54 Lectures
6+ Hours of Video
Lifetime Access
24/7 Support
Instructor Rating
Shaun Spalding

I'm an intellectual property attorney who represents Youtubers, game developers, and digital media companies. My clients include some of the top 40 most-viewed and most-subscribed Youtube channels in the world.

My goal: I want to share all my knowledge, not just use my courses to get new clients. I intend all my courses to be comprehensive and reveal all the secrets and advanced techniques I know so you can get your money's worth.

Teaching: I've spoken at conferences like SXSW Interactive, SXSW Music, Vidcon, and New Media Expo on legal and business topics. I've mentored over a dozen law students and legal clerks in contract drafting, negotiation, trademark, copyright, and internet law principles.

Hobbies: Outside of law, I am a published writer, transmedia producer, and former filmmaker and graphic designer. I know the issues of art-related businesses and freelancers because I am an artist myself. And in addition to knowing art, I know marketing: I have 50,000+ followers on Twitter, over 140k followers on Vine, and 6000+ followers on Tumblr.

Popular Bundles