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 the target marker controls where it launches the player. Move the marker and the launch changes. That is a powerful idea: building and coding are connected.
- target marker
- a small part that tells a script where to aim
- 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
- Target
- CannonTarget
Add one small marker part where the cannon should launch the player:
Build this partCannonTarget
BlockOpen recipe
CannonTarget
Block- Size
- 2 × 1 × 2
- Color
- Bright yellow
- Material
- Neon
- Anchored
- ✓ Yes
- Place
- Near the Stage 6 landing
Make CannonTarget transparent if you want it hidden.
Step 2 — Script the launch
Insert a Script inside CannonBase:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local base = script.Parent
local barrel = workspace:WaitForChild("CannonBarrel")
local target = workspace:WaitForChild("CannonTarget")
local launchEvent = ReplicatedStorage:WaitForChild("LaunchPlayer")
local LAUNCH_POWER = 110
local cooldown = {}
base.Touched:Connect(function(hit)
local character = hit.Parent
local root = character and character:FindFirstChild("HumanoidRootPart")
if not root then return end
local player = Players:GetPlayerFromCharacter(character)
if not player or cooldown[player] then return end
local direction = target.Position - barrel.Position
if direction.Magnitude == 0 then return end
cooldown[player] = true
launchEvent:FireClient(player, direction.Unit * LAUNCH_POWER)
task.delay(0.8, function()
cooldown[player] = nil
end)
end)
Press Play. Step onto the cannon base. Move CannonTarget 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. Give this checkpoint the same settings as Stage 1 (check AllowTeamChangeOnTouch, uncheck Neutral, match the pad's TeamColor to its Team), and uncheck AutoAssignable on the new Team so players always start at Stage 1.
Understand it
The server Script reads the direction from CannonBarrel to CannonTarget, checks a short per-player cooldown, then asks ParkourLaunchClient to apply one cannon blast on the player's character. That means the marker is the aim helper. Students can tune the game by moving an object, not rewriting a script.
Try this
Try this
Three short experiments. Predict before you run, then test your guess.
What happens if CannonTarget is too high? What if it is 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.
- Moving CannonTarget changes the launch.
- The player can land near Stage 6.
- Stage 6 checkpoint works.
If it breaks
- I launch the wrong way. Move
CannonTarget; the marker controls the launch direction. - I do not launch. Confirm the Script is inside
CannonBaseandCannonBarrelis named exactly. - The cannon detects me but does not move me. Make sure Stage 2's
LaunchPlayerRemoteEvent andParkourLaunchClientLocalScript still exist. - The cannon fires too many times. Check the
cooldowntable andtask.delay(0.8, ...)lines. - 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.