
Build a complete 3D action game in Unity using a high-quality asset package, implementing player movement with a state pattern, NavMesh enemy AI, VFX, pickups, health, and user interface.
Install Unity Hub and Unity 2021, sign in with a Unity ID, and select version 2021.3.13f1 with a personal license. Prepare to install Visual Studio Code next.
Install Visual Studio Code as the script editor and set up the .NET SDK 6.0 for Unity, then add the C# and Unity Code Snippets extensions.
If you want to see the screenshots in detail, please download the PDF file.
Set Visual Studio Code as the script editor in Unity. Create a test script to verify GameObject and function name detection, then delete the test script.
ABOUT THE BLURRY CAMERA
You will find the camera out of focus at the end of this video, this is because the 'Depth Of Field' effect in the post-process is on, but the camera is not in the right position yet, and this is nothing to worry about.
Because if you follow the next few videos, the blur should disappear after we set up the Cinemachine and set the camera to the right position.
OPTIONAL SOLUTION IF YOU DON'T LIKE THE FOV EFFECT
Another optional solution is to turn this effect off completely (you are going to lose the Depth Of Field effect though), to do this, please select the 'PP' game object under the GameLevel game object, then disable 'Depth Of Field' in the inspector window on the right side.
Create and reset the Player object, attach the LittleAdventurerAndie mesh as Visual, remove Visual's animator, add the Player Lights Prefab, and set the mesh layer to Player to finish setup.
Set up a Cinemachine virtual camera that follows and looks at player, with framing transposer, zero damping, distance 32, and perspective camera to mimic orthographic visuals with fov 25.
Create a script folder under game folder, add PlayerInput and Character C# scripts, attach them to the player game object as character controller, and open PlayerInput in Visual Studio Code.
Write the PlayerInput script to manage horizontal and vertical input with public float variables, captured in Update via Input.GetAxisRaw('Horizontal') and Input.GetAxisRaw('Vertical'), and reset to zero in OnDisable.
Implement character movement in Unity by wiring PlayerInput to MoveSpeed, calculating and normalizing velocity, aligning to the camera, and moving with a character controller in FixedUpdate.
Implement vertical velocity and gravity, move the player downward when not grounded using isGrounded, apply rotation toward movement with Quaternion.LookRotation, and only rotate when moving; set 180 facing bottom left.
Create a Unity animator controller for the player, add an idle state with the LittleAdventurerAndie_idle clip, enable looping, attach it to the player, and test in play mode.
Set up a looping run animation in Unity with a speed parameter, and connect idle and run transitions to speed, updating the animator in code to reflect movement.
Create a fall animation driven by an airborne bool and Fall state with zero-duration transitions to and from Idle, wire it to update with _cc.isGrounded and set gravity to -20.
Set up the footstep VFX for the player by adding the VFX prefab to a root holder under the visual game object, and disable auto play.
Create a run-state animator behavior script in Unity to trigger footstep VFX by using a StateMachineBehaviour named Player_Run, calling PlayerVFXManager.Update_Footstep(true/false) on state enter and exit.
Create the enemy game object to share the character script and animator controller with the player, setting up the root and avatar for a cohesive workflow.
Bake the navmesh in Unity to define walkable surfaces for enemy AI, setting max slope to zero and slope height to 0.1, so stairs are excluded and blue navmesh appears.
Add and configure a NavMesh agent for enemy AI in Unity, pair it with a character controller, adjust the collider, and set stopping distance to 2 to trigger attacks.
Reuse the same character script for players and enemies, moving the enemy toward the player with NavMeshAgent using SetDestination when distance exceeds the stopping distance, updating the running animation with speed.
Update the player input script to attack on left-click using a bool mouseButtonDown, check Time.timeScale equal 0 for pause menus with Input.GetMouseButtonDown(0), and reset input data in OnDisable.
Update the character script to drive a state machine with FixedUpdate, switch normal to movement, switch to attacking on left-click when grounded, clear input cache, and log result in Unity.
Before I became a programmer, I had been working as a digital artist for a really long time, how games look really matters to me. So when I started creating this tutorial, I really wanted to make the whole experience enjoyable, not only mentally, but also visually. I want you to see a product-level video game building up in your hands while you go through this tutorial, and I believe that will make the how learning experience more immersive.
This course comes with a production-level game asset package, including high-quality models with 4K textures, animations, environment models, a pre-constructed level prefab, and VFX prefabs.
In this course, we will build a basic 3D action game from scratch with high-quality game assets. I will provide you with all the character models, animations, environment, VFX, and Post-Process settings (sound & music not included so far) to make you feel like you are building a professional game from the beginning.
I will try to focus on every detail, but at the same time, it's better that you have some basic experience in Unity & C#, such as how to navigate the scene, move and rotate GameObjects, and understand how variables and functions work.
At the end of this course, you will be able to create game elements such as:
Install, and setup Unity & Visual Studio Code
Code basic character movement, attack, shoot and dodge abilities
Create a simple combo system
Control animations with animator controller, override animator controller, and animation event
Control VFX via script
Create AI with NavMesh system to control enemy behaviors
Use a basic state pattern to control the character's status
Create basic health & damage system
Create pickups & bullets
Game logic control & enemy spawn
Basic level design
How to use gizmo to debug
Create main menu and game menu with Unity UI system
Please NOTE that this course DOES NOT contain any sound and music assets so far.
*All of the assets (meshes, animations, VFX, etc.) provided in this course are only for educational purposes, please do not use them in any commercial projects.
By the end of this course, you will have a 3D action game that you can show off to your friends and experiment with your unique ideas.
Please enroll today, I'm looking forward to seeing you in the course.