Skip to main content

Stage 5: Fireball Cannon + player launcher

Course progressStage 5 of 10
~35 min
Before you start

Make sure the dash pad can carry you safely to Stage 5.

Build

a cannon path, cannon base, and cannon barrel

Learn

how the direction of a part can aim motion

Ship

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.

New words
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 part

CannonPath

Block
Open recipe
Size
30 × 1 × 10
Color
Dark stone grey
Material
Concrete
Anchored
✓ Yes
Build this part

CannonBase

Block
Open recipe
Size
8 × 3 × 8
Color
Black
Material
Metal
Anchored
✓ Yes
Place
Centered on CannonPath
Build this part

CannonBarrel

Block
Open recipe
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

Learning beat

Try this

Three short experiments. Predict before you run, then test your guess.

Predict first

What happens if you point the barrel too high? What if it points too low?

Compare

Try a short launch and a long launch. Which feels more exciting and still fair?

Connect

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 CannonBase and CannonBarrel is named exactly.
  • I overshoot. Lower LAUNCH_POWER.
Coach notes

This stage has a high inspiration payoff. Spend time letting students aim and test. The visible loop is the learning.