Learn how to make Games: Unity (Part 6) - Creating an Enemy and Spawn Point
Hi I'm Jerry from Bliz Studio LLC. In this video, we will be looking at creating an enemy in Photoshop, then bringing it in to Unity, and then spawning that enemy using Playmaker in Unity 3D. How to Make a Video Game With Unity3D and Playmaker Series: Part 1: Introduction to Unity3D - https://yout
Part 6 of the series gives the space shooter its opposition: an enemy ship drawn in Photoshop, a spawner that sweeps across the top of the screen dropping enemies at random intervals, and a cleanup barrier that destroys them off-screen. The spawner pattern here — moving emitter, random timer, prefab, destroyer — is one you'll reuse constantly.
Step 1 — Draw the enemy at actual size
Working in the same 1920 x 1080 document as the other game art, zoom to 100 percent so you design at true screen size — a common beginner mistake is drawing graphics far larger than they'll ever appear, wasting texture memory. Use the polygonal lasso to keep the enemy angular like the player ship, fill it orange-red (aggressive reads hostile), add a darker cockpit, and use Hue/Saturation lightness shifts for subtle shading. Copy it to its own document, delete the background for transparency, and save the PNG into the Sprites folder.
Step 2 — The moving spawner
Drag an enemy sprite in as Enemy - Spawner, placed above the play area on Z = 0 — the same plane as the player, or collisions will never happen. Its FSM stores a Random Float between 2 and 4 in a spawner speed variable, then runs an iTween Move By: X distance of 20 units (screen spans roughly -10 to +10), time driven by the spawner speed variable, linear easing, and loop type Ping Pong so it sweeps right, then back left, forever. Loop Don't Finish keeps the animation alive inside the state. Once it works, move the spawner just off-camera.
Step 3 — Enemy prefab
Drop a second enemy sprite into the scene as the real enemy. Add a Rigidbody 2D so gravity pulls it down the screen — gravity scale 0.5 gives a more readable fall than the default 1. Create a custom tag named enemy and assign it, then drag the object into a Prefabs folder (it turns blue) and delete the scene copy. The spawner will instantiate it from the prefab.
Step 4 — Spawn on a random timer
Inside the spawner, create an empty child named Spawn Point with its own FSM of two states. Random Wait pauses between two values — the video starts at 1-3 seconds and tunes down to 0.25-1.5 for better pacing — then transitions to Spawn Enemy, where Create Object instantiates the enemy prefab at the Spawn Point's current position, then loops back to the wait. Because the parent spawner is always sliding, every drop happens somewhere new: random timing plus a moving emitter gives unpredictable-feeling waves from two simple states.
Step 5 — Destroy off-screen
Spawned enemies pile up in the hierarchy forever unless removed — a real memory problem on mobile. Place a wide destroyer object below the screen with a Box Collider 2D and a custom destroyer tag. In the enemy prefab, add a Box Collider 2D with Is Trigger checked and an FSM with a Trigger 2D Event: on trigger enter with the destroyer tag, transition to a state holding the Destroy Self action. Watch the scene view as enemies rain down — each one blinks out of the hierarchy the moment it crosses the barrier, keeping the scene perpetually clean.





