Stage 5: Fireball Cannon + player launcher
Make sure the dash pad can carry you safely to Stage 5.
a cannon path, cannon base, and cannon barrel
how the direction of a part can aim motion
a launcher that fires the player toward the next stage
The big idea
The cannon looks like decoration, but it can also aim the player. Rotate the barrel and the launch changes. That is a powerful idea: building and coding are connected.
- LookVector
- the direction a part is facing
- barrel
- the long part of a cannon that points where it fires
- aim
- point something toward the target
Build it
Step 1 — Build the cannon
Build this partCannonPath
BlockOpen recipe
CannonPath
Block- Size
- 30 × 1 × 10
- Color
- Dark stone grey
- Material
- Concrete
- Anchored
- ✓ Yes
Build this partCannonBase
BlockOpen recipe
CannonBase
Block- Size
- 8 × 3 × 8
- Color
- Black
- Material
- Metal
- Anchored
- ✓ Yes
- Place
- Centered on CannonPath
Build this partCannonBarrel
BlockOpen recipe
CannonBarrel
Block- Size
- 4 × 4 × 12
- Color
- Really black
- Material
- Metal
- Anchored
- ✓ Yes
- Place
- On top of CannonBase, tilted toward the landing
Step 2 — Script the launch
Insert a Script inside CannonBase:
local base = script.Parent
local barrel = workspace:WaitForChild("CannonBarrel")
local LAUNCH_POWER = 110
base.Touched:Connect(function(hit)
local root = hit.Parent and hit.Parent:FindFirstChild("HumanoidRootPart")
if not root then return end
root.AssemblyLinearVelocity = barrel.CFrame.LookVector * LAUNCH_POWER
end)
Press Play. Step onto the cannon base. Rotate CannonBarrel and test again until the launch lands where you want.
Step 3 — Add the Stage 6 checkpoint
Place a SpawnLocation where the cannon lands. Add StageNumber = 6 and the matching Team.
Understand it
The script reads the barrel's facing direction. That means the part is the aim helper. Students can tune the game by rotating an object, not rewriting a script.
Try this
Try this
Three short experiments. Predict before you run, then test your guess.
What happens if you point the barrel too high? What if it points too low?
Try a short launch and a long launch. Which feels more exciting and still fair?
What else in a game could use a part's direction to aim?
Test your stage
- CannonBase launches the player.
- Rotating CannonBarrel changes the launch.
- The player can land near Stage 6.
- Stage 6 checkpoint works.
If it breaks
- I launch the wrong way. Rotate
CannonBarrel; its front direction controls the launch. - I do not launch. Confirm the Script is inside
CannonBaseandCannonBarrelis named exactly. - I overshoot. Lower
LAUNCH_POWER.
This stage has a high inspiration payoff. Spend time letting students aim and test. The visible loop is the learning.