Video summary
RTS Game Tutorial | Unity | Episode 1 - Basic Unit Movement
Main summary
Key takeaways
Video goal / what’s being built
- Tutorial series for an RTS (Real-Time Strategy) game in Unity: aims to cover typical RTS elements such as unit control, combat, base building, and resource management.
- This episode specifically focuses on basic unit movement (click-to-move) using NavMesh.
Project setup (Unity + templates)
- Uses Unity 2002 LTS (recommended by the author for the tutorial).
- Creation steps:
- Install the exact Editor version via Unity Hub (pre-releases/install editor list).
- Use the 3D URP template.
- Create an organized folder structure (an assets folder plus a new subfolder named
mto store unnecessary items more cleanly).
Terrain creation and camera positioning (RTS-style view)
- Creates a simple 3D Terrain so there is a ground surface for raycasting and navigation.
- Builds an RTS-style camera concept:
- Top-down but angled (rotation on the X-axis set to 45°).
- Notes that camera movement will be scripted in a later episode, so no camera scripts are added yet.
Unit creation + navigation setup
- Creates a basic unit:
- A 3D Capsule (resized/corrected position so it sits on the terrain).
- Adjusts CapsuleCollider radius (set to 0.3).
- Adds a NavMesh Agent so the unit can pathfind:
- Requires installing AI Navigation via Window → Package Manager.
- Notes current settings are left mostly default, with intent to fine-tune later (including obstacle avoidance radius adjustment).
Click-to-move implementation (raycast + NavMesh destination)
- Adds a script:
unit movementto the capsule. - Script behavior (conceptually):
- References the Main Camera.
- References the unit’s NavMeshAgent.
- Uses a Raycast from the camera through the mouse position when the right mouse button is clicked.
- Uses a LayerMask so the raycast only registers hits on the Ground layer.
- If the raycast hits the ground, the unit calls:
agent.SetDestination(hitPosition)
- Layer setup:
- Creates a new layer named
ground. - Assigns the Terrain to that ground layer so clicks register on walkable surfaces.
- Creates a new layer named
Making the terrain walkable (NavMesh baking differences in Unity 2002)
- Explains an issue: simply adding NavMesh previously might have worked, but in Unity 2002 some older workflows are obsolete.
- Fix uses the newer approach:
- Select Terrain
- Add a NavMesh Surface component (non-obsolete workflow).
- Enable Bake, then wait a moment.
- Uses Gizmos to verify baking:
- Walkable areas turn blue after baking.
- After baking, clicking on the terrain successfully moves the unit via NavMesh.
Camera adjustment for playtesting
- Adjusts camera position closer so the unit is visible (angle left as-is).
Demonstration + plan for next episode (selection logic)
- Demonstrates that every unit with the movement script moves, since clicking sends all agents to the same destination.
- Plans the next episode to implement unit selection so only the selected unit(s) move when clicking.
Main speakers / sources
- Speaker: The tutorial creator (single host) guiding through Unity steps and code setup.
- Source: Unity (Unity Hub / Package Manager / NavMesh Agent / NavMesh Surface, Raycasting, LayerMask).