This is the Complete Unity C# Developer 3D, the long-awaited sequel to the Complete Unity C# Developer 2D - one of the most successful e-learning courses on the internet! Completely re-worked from scratch with brand-new projects, our latest teaching techniques,. You will benefit from the fact we have already taught over 250,000 students game development, many shipping commercial games as a result.
You're welcome to download, fork or do whatever else legal with all the files! The real value is in our huge, high-quality online tutorials that accompany this repo. You can check out the course here: Complete Unity C# Developer 3D
Instantiating At Runtime, Make Components Communicate, Create Detailed 2D UI, Use BitBucket, Using Virtual Controls, Craft C# Classes, Customise Particle Effects, Player Power Ups & More (REF: AA_CU2)
This is a Unity project. If you're familiar with source control, then "clone this repo". Otherwise download the contents, and navigate to Assets > Levels
then open any .unity
file.
This branch is the course branch, each commit corresponds to a lecture in the course. The current state is our latest progress.
Here are the lectures of the course for this section...
- This game is based on classics like Star Fox and Panzer Dragoon.
- We will be using Unity 2017's brand-new Timeline facility.
- This will be fast-paced fun rail-shooter.
- A quick look at an example of a Rail Shooter.
- What are our core game features and priorities?
- Creating a prototype to answer key questions.
- Update to at least Unity 2017.2.
- Create a new 3D project.
- Set up your repo.
- Add terrain to your level.
- Use the raise and lower terrain tool to make mountains.
- Resize and reposition the terrain.
- Find texture assets on the Unity Asset Store.
- Add terrain texture, change scaling, change metallic and smoothness.
- Bump Maps versus Height Maps versus Normal Maps.
- Procedural versus 6-sided skyboxes.
- Applying skybox asset to your scene.
- Some performance tweaks to help avoid slowdowns.
- Downloading asset pack for space ship.
- Building modular spaceship.
- What a splash screen is.
- Make first game scene load after delay.
- Choose background music for your game.
- About game objects getting destroyed by scene load.
- Ben's injection pattern for persistent music.
- Using
DontDestroyOnLoad()
.
- Import Standard Assets > Utility.
- Setup a waypoint circuit using
WaypointCircuit.cs
. - Use the
WaypointProgressTracker.cs
script. - Make the camera follow a fixed path.
- Considerations for Waypoint system versus Timeline.
- Q&A answers and responses.
- Good tips from students.
- About using virtual controls.
- Introducing
CrossPlatformInputManager
. - Understanding control throw for keyboard and gamepad.
- How input sensitivity & gravity work.
- Using
[Tooltip("Handy tip")]
attribute for inspector tips. - Understanding throw and movement speed.
- Using
transform.localPosition
- How to use
Mathf.Clamp()
- Constrain our player movement to the screen.
- Getting clamped vertical movement working.
- Defining Roll, Pitch and Yaw.
- How to rotate to aim at the right place.
- Experience order sensitivity in rotations.
- Using
Quaternion.Euler()
. - Setting
localRotation
from code.
- Set pitch based on screen position.
- Set pitch based also on control throw.
- Set yaw based on screen position.
- Set roll based on control throw.
- Tune rail speed and camera FOV.
- Tune ship speed, rolls, clamps.
- Note about 16:9 aspect ratio in game window.
- Tweak the rail position to give the feeling of speed.
- Use particles to visualise where our ship is shooting.
- Introduction to Unity's particle systems.
- Create particle system that looks like bullets or lasers.
- Create explosion particle effect.
- Attach SFX component to explosion particle.
- Use more of the particle system modules.
- Create obstacles to avoid.
- Create placeholder enemies for the player to aim at and shoot.
- Create 10-20 seconds of gameplay setup, ready for our functionality.
- Deep dive into the player movement including understanding why we have created xOffset, what exactly Time.deltaTime is calculating and why we clamp our movement.
- Q&A answers and responses.
- Good tips from students.
In this video (objectives)...
- Organise Assets folder.
- Check right game objects have prefabs.
- Scan read code looking for major errors.
- Discuss idea of running the game from any scene.
After watching (learning outcomes)...
When returning to a project, or switching modes from designer to coder, you should be able to tidy your project, and feel ready to dive back into the code.
In this video (objectives)...
- Attempt to detect collisions with the terrain.
- Explore Unity (and Ben's) collision matrix.
- Discuss static, rigidbody and kinematic rigidbody colliders.
- Use
OnTriggerEnter()
to detect player hitting things.
After watching (learning outcomes)...
Determine what sort of colliders to add to in order to raise collision and trigger messages.
In this video (objectives)...
- Correct an error in Unity's
WaypointCircuit.cs
- How NOT to use "Manager" in the name of your scripts.
- Create a new
CollisionHandler
component. - Rename our
Player
toPlayerController
. - Use
SendMessage()
to communicate between components.
After watching (learning outcomes)...
Create a new well-named component to prevent your existing component code from getting too large.
In this video (objectives)...
- Attached our bundled VFX and SFX prefab to the player.
- Show consequence of disabling in the Inspector.
- Use
.SetActive(true)
to enable a game object during play.
After watching (learning outcomes)...
Enable a game object from C#, useful for combined special effects (FX) prefabs.
In this video (objectives)...
- Over the singleton pattern as it applies to the Music Player.
- Pseudocode the logic.
- Use
FindObjectsOfType()
.
After watching (learning outcomes)...
Setup a singleton pattern for self-destroying objects in Unity, without using the concepts of static variables.
In this video (objectives)…
- Turn on World collisions on our particle system.
- Ensure our enemies have non-trigger colliders.
- Use 'OnParticleCollision()' to detect collision.
After watching (learning outcomes)…
Use particle systems as bullet streams, and detect the collisions with game objects (e.g. enemies)
In this video (objectives)…
- Remove colliders from asset pack prefabs, returning to vanilla state.
- Arrange for enemies to add their own colliders on start.
After watching (learning outcomes)…
Arrange for game objects to add their own required components at run time, reducing their dependency on assets being setup a particular way.
In this video (objectives)…
- Discuss how to recreate our explosion prefab.
- Why we use prefabs differently for the enemies.
- Instantiate an explosion on enemy death.
- Make the explosion FX self-destruct.
After watching (learning outcomes)…
Instantiate game objects at run time, parent them to in the hierarchy, and chose their position in world space.
In this video (objectives)…
- Add a UI text element to our game.
- Overview the new Canvas object.
- Add a score and customise the font.
After watching (learning outcomes)…
Add UI text elements to the game, and position and scale them. Also find and use free custom fonts.
In this video (objectives)…
- Overview what a class is in programming.
- Add
ScoreBoard.cs
to our UI text. - Write our first
public
method.
After watching (learning outcomes)…
Describe in basic terms what a class is in Object Oriented Programming (OOP).
In this video (objectives)…
- Deep discussion regarding Component.SendMessage.
- Some tips from students.
- Some questions from students.
After watching (learning outcomes)…
Have greater clarity on how Messages are used.
In this video (objectives)…
- Ensure our Canvas Scaler is set correctly.
- Use
FindObjectOfType()
to find thescoreBoard
. - Communicate between enemy and scoreboard.
After watching (learning outcomes)…
Separate a script into two, and arrange for them to find and and communicate with one another in a basic way.
In this video (objectives)…
- Use
git stash
to safely discard our changes. - Use branch and reset to discard multiple commits.
After watching (learning outcomes)…
Restore a project that has been tracked under version control to a previous commit safely.
In this video (objectives)…
- Setup an input Button for "Fire"
- Expose an array of game objects to the Inspector.
- Automatically iterate over the array using
foreach
- Give player ability to start and stop guns.
After watching (learning outcomes)…
Use a foreach
loop to iterate over an entire collection automatically.
In this video (objectives)…
- Create a system for storing enemy hitpoints.
- Decrement enemy hitpoints when hit by player bullet.
- Kill enemy when hitpoints are below 1.
After watching (learning outcomes)…
Set up a simple health system that decrements when hit by player bullets.
In this video (objectives)…
- Introduction to the concept of the level design beat chart.
- See how the ups and downs of a level can be mapped / charted.
- Consider the beats of your game in relation to the story you are wanting to tell.
After watching (learning outcomes)…
Set up a level design beat chart for your level.
In this video (objectives)…
- Discuss the most important considerations for our level.
- Create good spawn points for our enemies.
- Match our level design to our beat chart.
After watching (learning outcomes)…
Created a level which is ready for the final player flight path to be created.
In this video (objectives)…
- Set up a Playable Director on one of our enemy ships.
- Create a simple animation using timeline for our enemy.
- Tweak the position of the enemy so that we can shoot and destroy it.
After watching (learning outcomes)…
Use Unity Timeline to animate one enemy ship to fly in front of the player.
In this video (objectives)…
- Create a master timeline to drive all other timelines.
- Add player rig to master timline.
- Move the player rig through the scene to create the flight path.
After watching (learning outcomes)…
Use Unity Timeline to create the player flight path.
In this video (objectives)…
- Create a new timeline for an enemy wave.
- Add enemy wave to the master timeline through a control track.
- Duplicate enemy wave for re-use.
After watching (learning outcomes)…
Use Unity Timeline to create re-usable enemy waves consisting of multiple enemy animations.
In this video (objectives)…
- Set up timeline track groups.
- Brainstorm creative ways to use timeline for your project.
- Add something new with timeline - for us it will be a character image with audio during key moments in the level.
After watching (learning outcomes)…
Use Unity Timeline to create UI popup with audio dialogue.
In this video (objectives)…
- Refactor our gun enabling code.
- Find the particle system emission module.
- Stop bullet stream disappearing when we cease fire.
After watching (learning outcomes)…
Turn a particle system emission on and off in C#.
In this video (objectives)…
- Create an visual atmosphere in our level which matches our intention.
- Add particle effects as rocket boosters to ships.
- Add fog to our scene to soften the look.
After watching (learning outcomes)…
Use lighting, fog and particles to create a visual atmosphere in the level.
In this video (objectives)…
- Re-iterate some of the core things we have learned in this section of the course.
After watching (learning outcomes)…
Ready to take on the next section!