
Implement player input and cursor-based aiming for shooting, with a following camera and lighting, plus a simple map; add enemies with state-machine AI and audio-visual feedback.
Set up a Unity 2020 URP project for a 2d shooter, import starter assets, sprites, and sounds under Creative Commons, and initialize the first scene with required packages.
Learn how to ask questions, search the Q&A, attach scripts or screenshots, and use provided resources, packages, and a GitHub repo to troubleshoot, then move to implementing the player avatar.
Prepare pixel sprites in Unity URP by setting texture type to sprite, converting from single to multiple sprites, setting pixel per unit, and applying point filtering with non compression.
Install the sprite editor via the package manager, slice the sprite into a grid with nine columns and eight rows, and configure the pivot for correct rendering.
Create a player avatar from a hero sprite, attach a dynamic rigidbody with zero gravity and frozen rotation, and add a separate movement collider for walls to prepare for input.
Learn to capture player input in Unity using an agent input script and Unity events, wiring horizontal and vertical axes to drive a 2d shooter avatar.
Serialize a movement data object to control acceleration and max speed, apply calculated velocity in fixed update to the rigidbody, and test in the inspector.
Create idle and movement animations from sprite frames, link them to an animator controller, and use a boolean parameter named work to switch between idle and movement with zero-duration transitions.
Drive the 2d shooter prototype animations by adding an agent animations script to toggle the walk animation based on velocity and connect to the agent movement’s velocity change Unity event.
Learn to rotate a 2d shooter character to face the mouse cursor by flipping the avatar sprite and mapping the pointer from screen to world space with the main camera.
In Unity 2020 URP, this lecture shows a 2d shooter character looking at the pointer by computing the pointer direction, flipping the sprite, and using screen-to-world input.
Create a test map in Unity by splitting a dungeon map into 16x16 tiles, building a tilemap grid, and painting tiles with a tile palette to test walking and shooting.
Learn how sorting order and sorting layers control render order in Unity's sprite renderer, using floor, background, foreground, and agent layers to determine what appears in front.
Create walls around our map to form a test ground for shooting mechanics and enemies. Use tile-based walls with corners and 3d-like tops, then add colliders to enable player-wall collisions.
Install cinemachine from the Unity package manager and add a virtual camera to follow and look at the player in the 2020 URP 2d shooter prototype.
Add torches to illuminate the scene, create a torch animation with a flickering point light, and place torches on walls using sorting order; convert into a prefab for consistent updates.
Organize your scene by grouping torches under a light object and enable shadow casting with a shadow caster component on the player avatar to create dynamic shadows.
Explore pixel perfect camera in Unity to render torches and world assets at a low pixel resolution by setting pixel per unit to 16 and adjusting resolution.
Prepare the weapon sprite by adding a weapon parent, align the assault rifle with a pixel perfect camera, and rotate toward the mouse pointer before scripting shooting.
Implement a script to make the weapon follow the mouse cursor in a 2D Unity URP shooter, calculating the aim direction and angle from the pointer and rotating the weapon.
Implement shoot input in Unity via the input system, add fire button down and released events, and wire a weapon script to fire once per press.
Refactor the agent weapon to call shooting via a serialized weapon reference, retrieving the weapon from children, and expose public shoot and stop shooting methods with null checks.
Refine a 2d shooter’s weapon system in unity by introducing a weapon data asset, ammo management, and shoot/no-ammo events to drive the agent weapon and muzzle effects.
Create and configure a weapon data scriptable object for the assault rifle, setting ammo capacity, automatic fire, weapon delay, bullet spread, and multi-bullet options, then test in play.
Configure the bullet data scriptable object in Unity to set speed, damage, friction, bounce, and knockback, then create and test regular bullet data for a 2D URP shooter.
Wire bullet data into weapon data and implement a spawner that instantiates bullets at the muzzle with spread rotation, using an abstract bullet class for flexible behavior.
Learn to detect bullet collisions in Unity by making bullets triggers, listening for OnTriggerEnter2D, and destroying bullets on impact to prevent memory issues.
Create a reusable weapon audio system in unity by building an abstract audio player, adding weapon audio with shoot and empty clips, and wiring it to weapon events.
Create a crosshair texture and apply it with Cursor.SetCursor in a game manager. Play mode reveals the crosshair and enables shooting in the Unity 2020 URP 2D shooter.
Create a Unity 2020 URP 2D shooter enemy with a detection circle that chases player, uses a state machine to time attacks, and handles damage via bullets and collider layers.
Add enemy audio feedback by playing hit and death sounds via an agent sounds script, wiring hit and die events to play corresponding clips with variable pitch, in Unity.
Introduce a simple ai using a state machine with idle, chase, and attack states, based on player range checks and attack cooldowns, plus detection and obstacles.
Implement an enemy ai brain to drive movement via a shared ai agent input interface, enabling player targeting and event-driven behavior for a 2d shooter prototype in Unity URP.
Implement a modular state machine for the enemy ai with idle, chase, and attack states, using abstract state, transition, and decision classes and movement data in Unity.
Create a visual ai for enemies with idle, chase, and attack states, transitions, and actions linked to an enemy brain. Start in idle state and prep actions for next video.
Implement the attack state by adding an attack action and a distance-based transition from chase to attack, ensuring the enemy stops at range 0.8 and attacks the player.
Fix rendering issues by enabling transparency sort mode to custom axis in URP, sorting sprites by y position, and adjusting pivot points in the sprite editor for correct layering.
Develop a reusable enemy attack system in Unity URP for a 2d shooter, featuring an abstract enemy attack class, an enemy brain reference, and a wait-before-attack routine.
Create a modular feedback system with an abstract feedback class and a feedback player attached to events like getting hit. Implement create feedback and complete feedback using do tween.
Implement muzzle flash for a 2D shooter in Unity URP by adding a sprite and a 2D point light, animating color and alpha with coroutines, and triggering shoot events.
Implement a weapon shake feedback for the 2d shooter by using DOTween's do shake position on the assault rifle, configuring duration, strength, vibrato, randomness, snapping, and fadeout.
Implement bullet impact feedback by spawning impact prefabs at hit points around enemies and obstacles, using random offsets within the unit circle and obstacle raycast hit data.
Fix the bullet impact effect so it spawns at the wall edge, not the bullet center, by adding a bullet layer mask and using a direct cast in physics 2d.
Learn to implement enemy death effects in a Unity URP 2D shooter by creating a dissolve shader with Shader Graph, using materials and textures before destruction.
Learn to build a solid color shader for a 2D sprite in Unity 2020.2 URP using Shader Graph, linking a texture to a color via main texture, alpha, and multiply.
Fix a solid color shader in Unity 2020.2 using a branch node to show white on hit, with an exposed make solid color property and a flash feedback script.
Fix bullet issues by widening wall colliders and ensuring bullets stay within play area. Add an isDead flag to prevent a single bullet from hitting multiple enemies in OnTriggerEnter2D.
Implement a time freeze effect with a singleton time controller to manage Unity time scale during hits, resetting to normal after the pause.
Create a non-looping player death animation in Unity URP 2D shooter, trigger it via animator, and disable input, gun, and weapon visibility for a polished death sequence.
Add knock back to enemies by extending the agent movement with a knocked back flag. Use an I knock back interface and rigidbody impulse with duration and velocity reset.
Implement an object pool to reuse bullet shells and provide visual feedback by spawning shells from a fixed pool rather than creating and destroying objects.
Add a background music object by introducing an audio source, select a theme clip, set volume to 0.3, and enable play on awake to create a livelier 2d shooter scene.
Create a simple top UI in Unity 2020 URP for a 2D shooter, adding health and ammo panels in a horizontal layout with a sliced frame and ready placeholders.
Create health UI by building heart prefabs, arranging them in a horizontal layout group, and scripting a UI health component to spawn and update heart icons as lives change.
Link the UI health to the player's health and initialize max health in start, while clamping health between 0 and max to update the UI accordingly.
Add an ammo change event to update the ammo UI whenever weapon ammo changes, and connect it to the player weapon to reflect current ammo.
enable line of sight for enemy ai by adding a look decision that uses a raycast with distance and layer mask to spot player and trigger a player spotted event.
Prepare resource scripts to replenish ammo and health from enemy drops. Create a scriptable object for resource types health and ammo with randomized amounts and pickups that grant resources.
Create item prefabs in Unity 2020 URP for a 2d shooter, including ammo and health, with sprite rendering, colliders, resource data, and audio, plus prefab variants and enemy drops.
Create an item dropper that uses a serialized item data list with drop rates to randomly spawn loot, using roulette wheel selection and instantiation of the chosen prefab.
Enable item pickups by using the player's trigger collider to detect resource items, switch on resource type (health or ammo), and apply health or ammo rewards accordingly.
Build the Unity 2020 URP 2d shooter to PC, Mac, and Linux standalone, and fix editor-only errors by using platform directives for production builds.
UPDATE:
In this course we tackle some intermediate topics like AI and we code it in a way that you can reuse it - which also can be a bit more difficult for beginners. The course is about creating the 2d shooting mechanic and polishing it with multiple special effects for it to be fun to play. We will create a simple AI system for the enemy using FSM, create custom Shaders, and explore why it is important for others to playtest your games and give you feedback.
Course should work with changes done to Shader Graph in version Unity 2020.
UPDATE 2:
Full project files in zip archive added to each section at the end.
Each video where we write some code now has a link to scripts on github.
Introduction:
Let's make a 2d top-down shooter in Unity 2020 using universal Rendering Pipeline and focusing on juiciness of the gameplay!
In this course beside implementing a standard game mechanics like shooting, picking up health/ammo and enemy AI we will focus our attention on adding visual and audio details into our game. URP will helps us a lot with its 2D lights system and the Shader Graph Editor which makes creating shaders (how game graphic is rendered) really easy.
While it is important to have bug free game mechanics that fits our game genre we also want to make our game stand out. Our goal is to make the game fun to the players and it is achieved only by balancing our game and making sure that our player knows exactly what is going on in the game. In this course we will focus on the latter.
Feedback is the main path that we as game designers have to communicate to the player what is going on inside the game. To make sure that our player feels like his / her actions influence the game world (Agency) we will make sure to give every action appropriate visual and audio queue. An example would be that shooting will cause the screen to shake, enemies on being hit flash and are knocked back, bullet that hits a wall will produce ricochet sound and a cloud of dust - in summary the player will hopefully have fun playing our game.
We will implement custom shaders, animations, tweens (animations using code - DoTween asset and inbuilt Coroutins), audio effects and light effects. in addition we will stricture the project in a way that you can easily balance the game by exposing important settings/values using ScriptableObjects.
To create the project we will utilize UnityEvents to make sure that we can easily add new actions to the events happening in the game from Unity inspector instead of having to modify out code. I will do my best to show you how to write object oriented, clean code so that you can easily understand it.
I encourage you to check out the free video about the outline of the course to learn more.
See you in the course!
-Peter from Sunny Valley Studio