Module 2 Challenge
Tutorial
·
intermediate
·
+0XP
·
30 mins
·
(45)
Unity Technologies

This module focuses on configuring the player-controlled cannon. Learners will explore the cannon prefab, connect Input System actions to its components, and implement functionality to tilt and turn the cannon as well as its wheels.
By the end of this module, learners will be able to:
- Understand the structure of the cannon prefab and its components.
- Map Input System actions to the rotation and movement of game objects.
- Apply input values to tilt and turn the cannon barrel.
- Synchronize the rotation of the cannon wheels with player input.
Languages available:
1. Challenge
Challenge
Estimated Time: 30 minutes
In this challenge, adjust the controls of the cannon to your liking.
Challenge Steps
- Experiment with the turning and aiming speed values until you have something that feels right to you.
- Open the additional levels you created in the previous challenge and place your Cannon prefab in the scene.
- Experiment with the rotation and turning minimum and maximum values to find out what works for where you’ve placed your camera in these levels.
2. Bonus Challenge
Bonus Challenge
- Add a bool to your CannonController called isClamped and set it to true.
- Add an if statement to check the isClamped variable and move the Math.Clamp method into the if statement body.
- Experiment with the ability to clamp your cannon or move it freely in your scene.