
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.
Learn to implement basic movement and set up a Unity project with URP for a 2d shooter prototype, including graphics setup and orthographic camera tweaks.
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.
Implement basic player movement by applying a rigidbody velocity from the normalized movement input. Awake to fetch the rigidbody, enforce component requirements, serialize speed, and set up future acceleration.
Use a scriptable object to store movement data (speed and acceleration) in Unity, create presets, and feed them to the agent movement script for flexible 2d shooter prototypes.
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.
Add footstep audio to your juicy 2d shooter prototype by implementing a reusable step audio system across avatars and enemies, using an audio source, random pitch, and animation-triggered clip playback.
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 to set up tile maps and a floor palette in Unity 2020 URP, using brushes, erasers, and layered rendering to paint floors and manage wall front and back overlaps.
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.
Add collisions to the town map by painting walls as a single composited collider and setting the rigidbody to static, then test in play mode to refine the collision map.
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.
Tune global light intensity across sorting layers to set the dungeon mood. Add a torch-like point light on the player, adjusting radius, color, and target sorting to illuminate surroundings.
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.
fix weapon rendering in a 2D Unity URP shooter by flipping the weapon sprite on the y axis and adjusting its sorting order relative to the player.
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.
Implement and refine the weapon script by adding automatic and semi-automatic firing logic, handling ammo and reload states, and wiring update, shoot, try shooting, and finish shooting routines.
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.
Create a bullet prefab with a sprite-based fly animation, a capsule collider, and a kinematic rigidbody, then assign it to a bullets layer for collision handling.
Configure bullet collisions using physics layers and a collision matrix, assign bullets, players, enemies, and obstacles to dedicated layers, and define bullet data with BulletDataSO for reusable behavior.
Create a regular bullet script that inherits from the bullet base, uses a kinematic rigidbody, and moves with MovePosition in fixed update, exposing speed and drag data.
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.
Duplicate the player setup to create an enemy gameobject, assign the enemy sprite, build idle and walk animations with frames, and configure an animator override controller with step sounds.
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.
Implement the IHittable interface to detect hits, reduce the enemy's health, and destroy it on hit using a Unity event.
Create an enemy data scriptable object with serialized health and damage, and implement it in the enemy script. Reduce max speed and acceleration to differentiate enemy behavior.
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 an AI framework by implementing action data, movement data, and an abstract decision class, then wire transitions, states, and an enemy brain to drive a 2D shooter behavior.
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.
Create a distance decision in Unity to determine when an enemy spots the target within a serialized range and transitions to chase, with gizmo visualization.
Implement chase and idle behaviors in Unity URP by creating chase and idle actions, guiding enemies toward the player with movement data and direction, and wiring transitions between states.
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.
Implement the IHittable interface on the player, expose health and getHit, handle damage and death, and add audio-visual feedback to juice up combat.
Define juiciness in a Unity 2D shooter by adding visual and audio feedback, modular feedback for weapon, player, and enemies, and connect to self-determination theory.
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.
Create a flashlight feedback in Unity URP to control a muzzle flash light via a light target, with on/off delays and coroutines in the shoot feedback.
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.
Learn to implement camera shake for a 2d shooter using Cinemachine, configuring noise and a custom shake cinema feedback to control amplitude, intensity, and duration during fire.
Implement bullet impact prefabs for enemies and obstacles, using smoke effects and animations, with animator controllers and prefab variants and post-animation destruction.
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.
We convert the enemy into a prefab, adjust its shadow and color variant, and test in play mode; next video tackles a custom shader to make enemies flash white.
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.
Create a 2d shooter death effect by implementing a dissolve shader in Unity 2020.2 URP, driving the dissolve with a shader graph using outline, color, and noise scale.
Create a custom dissolve death feedback that tweens the enemy's dissolve value from 1 to 0 and destroys the enemy via a death callback once the dissolve completes.
Implement post-processing in Unity URP to boost visuals with bloom and HDR glow, using global volumes and a dissolve shader for a vibrant 2d shooter prototype.
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.
Analyze tester feedback from a published 2d shooter prototype to improve shooting feel, hit clarity, health balance, knockback, and add colliders to reduce enemy clumping.
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.
Deploy an object pool powered bullet shell generator to spawn shells around the player with downward, random directions using DoTween to tween motion and rotation.
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.
Build a functional ammo UI in Unity with an ammo panel, image, and dynamic TextMesh Pro count, align and size it, and implement a script to update ammo display.
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.
Configure a restart menu by scaling the canvas, anchoring panels, and wiring a restart button via the game manager to reload the scene when the player dies.
Unity 2020 URP 2d shooter prototype by implementing an enemy spawner that spawns prefabs at random corners with delays, using spawn points, counts, and coroutines.
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.
Learn to implement an enemy item drop system using a roulette wheel selection with an item dropper, supporting multiple items with configurable drop rates, triggers, and layer-based collision.
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.
learn how to change the player sprite, create a prefab variant, and adjust the movement animation using a speed multiplier to enable believable backward walking.
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