Random obstacle size, direction, and speed
Tutorial
·
Beginner
·
+10XP
·
45 mins
·
(46)
Unity Technologies

1. Overview
2. A note about learning to code
3. Create and attach a new script
4. Understand the script structure
5. Change the size using a fixed value
6. Add randomized size logic
7. Create variables for size range
8. Auto-format your code
9. Apply force to the obstacles
10. Set gravity scale to zero
11. Randomize the speed
12. Randomize direction
13. Expose variables in the Inspector window
14. Final script sample
Optional Step