Part 3 - Random obstacle properties
Estimated Time: 45 Minutes
Summary
In this tutorial, you’ll write your first Unity script to control how each obstacle behaves. By assigning random properties — like size, direction, and speed — you’ll make your game world feel unpredictable and alive. Along the way, you’ll learn key C# scripting concepts, how to edit prefabs directly, and how to test and tune behaviors in real time.
Go to Tutorial
Click here to access the full tutorial on Unity Learn
Checklist
- Created a new C# script for the obstacle.
- Used
Random.Rangeto randomize size. - Used
Random.Rangeto randomize speed and direction. - Applied the script to the Obstacle Prefab.