7.4 — Ladders II: Mounts, Tops & Polish
Your ladder works in the middle and fails at both ends. Climb it and keep holding W: you rise into the ceiling, or fall off the moment the zone ends. The middle of a ladder is easy. The last three tiles are the hardest problem in platformer engineering, and nobody has solved them for you — there are no ladders in this project except the one you built in 7.3.
A climb that starts when the player means it to and stops when the player has arrived — at the bottom, at the top, and everywhere the trigger zone and the ladder picture disagree about where either of those is.
First, before any code: cut that into parts small enough that you could look each one up on its own.
- Say when the climb startswhat does this part do?Read: 7.3 — the trigger zone and the two callbacks it sends
- List every way the climb can endwhat does this part do?Read: 7.3 — the climb flag on PlayerController, and every place that reads it
- Ask "have I arrived?" with the ground check you already ownwhat does this part do?Read: 6.2 — the ground check you chose: raycast, overlap circle, or touching layers
- Re-tune that check for a player who is climbingwhat does this part do?Read: 7.2 — the Ground layer you made, and the mask you repaired to use it
- Decide where a climb with nothing to arrive at endswhat does this part do?Read: 7.2 — the Collision tilemap, and the paint-on-the-right-layer decision
- Order the arrival check against the climb movementwhat does this part do?Read: the climb branch you wrote into Update() in 7.3, on top of the movement from 1.4
- Make the mount readable, or decide it does not need to bewhat does this part do?Read: 5.3 — the Canvas HUD, and the one scene that owns it
Every part above can be answered out loud, in one sentence, before the script is open — and that is the whole test. The climb mechanism already exists and does not change; what fails at the ends of a ladder is a handful of independent decisions that all wear the same symptom until they are separated. The reach of the arrival check, the order of two branches inside one Update(), and the frame the exit runs on are three different failures with three different fixes, and a student who treats them as one thing called "the ladder is broken" changes all three at once and learns nothing from the result.
The two-minute test: can you answer the part in one sentence without opening Unity? "Where the climb ends when there is no ledge above it" passes. "Fix the top of the ladder" does not — a part that names a symptom instead of a decision is not a part yet, it is the problem again in fewer words.
Your turn
Pick two of the parts above and say in one line what each one actually does.
Two exits can want to fire on the same frame — the cap stops the player and the arrival check agrees there is floor beneath them. Say which one you want to win, and describe what the player sees during the frame it takes to find out.
A capped ladder moves the last step out of your script and into level design. Name one thing that gets easier because of that, and one thing a tester can break that no line of code can protect against.
The bottom of a ladder is the mirror of the top: the zone ends and the player is standing on nothing. Which of your exits covers that case today, and what does the player see if none of them does?
Game view → press Play and climb your ladder from 7.3, holding W past the top tile. Write down exactly what happens — every build does something slightly different, and yours is the only build that matters. Then read the three classic answers:
| Answer | What the player feels | What it costs you |
|---|---|---|
| Stop at the top. While climbing, ask whether there is floor under your feet; if there is, leave the climb state and stand up. | Honest and sudden. The climb ends the moment you have arrived. | One more physics question per frame, and a precise definition of "at the top". |
| Pop off. Holding W past the top applies a small upward hop that carries you onto the ledge. | Flows straight into a jump. Can feel generous or magical. | Fiddly physics. The hop can overshoot into a spike or an enemy you never saw. |
| Cap the ladder. Paint a solid tile above the top of the strip so the player simply stops under it, then jumps the last bit. | Blunt and completely learnable. Every player reads it instantly. | Level design must guarantee the last jump is possible with the jump you tuned in 6.1. Zero new code. |
Collision tilemap, and it works because 7.2
already made that tilemap solid. Before you write anything, check whether your level can
simply be shaped to solve the problem.
Then build the half that is clicks, in this order. Every step names its pane.
-
Window ▸ 2D ▸ Tile Palette → if you chose the cap, paint one solid
tile above the top of the strip, on
Collision. Game view → press Play and test the last jump before you write a line of code. If the jump does not clear it, the answer is to move the cap, not to add a pop-off. - Hierarchy → decide the mount rule before you build anything for it: walking into the zone and having nothing happen until W; being grabbed the moment you step in; or only grabbing when W is pressed while inside the zone, so walking past sideways never snags you. Answer the question that decides it: what does the player expect when they walk past a ladder on the ground?
-
Inspector → the zone → if you want a prompt, build it and give it a
death rule. Three honest options, and the project supports all of them:
Whatever you choose, the rule is the one you applied to the coin: a prompt dies the instant it is obeyed or no longer relevant. A prompt that lingers after you have started climbing is worse than no prompt.Prompt What the player sees What it costs Nothing at all — make the ladder obvious through geometry and tiles A ladder that looks climbable Nothing. And it is the option real games choose most often. A Debug.Log()line while the mount is possibleThe Console, which your player cannot see Nothing. The HUD from 5.3 lives in Start(index 0) and shows your own stats — it is not in this scene, so anything you want to watch is a Console line.A world-space text object (a TextMesh in the scene) toggled active while the mount is possible Floating text, in the world, above the ladder A new object, a new reference, and a rule about when it disappears.
The climb mechanism itself does not change this hour. What changes is where it stops, and the order the branches run in.
- Which question do you ask to detect "I have arrived"? Name the exact API you already own from 6.2 — you built a ground check there, in whatever form you chose. Reuse it; do not write a second one.
- How far down does that question need to reach while you are climbing? Your normal ground check distance was tuned for walking. What number would miss the ledge, and what does an over-long reach risk detecting instead?
- What is the very first thing that must happen when you decide the climb is over — the state flag, the gravity, or the movement? Justify the order.
- Which branch of your
Update()runs first: the climb movement or the arrival check? If the movement runs first on the frame you arrive, what does the player do for one frame, and does anyone see it?
-
Project window →
PlayerController→ list every way the climb can end — reached the top, jumped off, died, walked back out of the zone — and find the one you have left out. Then reuse the ground check instead of writing a second one, and re-tune its reach for a player whose feet are not on the floor. Test both directions: too short and the climb never ends; too long and it ends with a whole ladder still above you, because the floor at the bottom of the shaft came into range. - Same file → the climb branch → fix the order the two branches run in, then test at a deliberately low frame rate. Print the state and the vertical speed together and watch which one changes first.
- Same file → the mount rule → write the sentence you chose in the editor half as one condition, and make the zone's two messages the only thing that writes the flag unless you have a reason to do otherwise (the repair you chose in 7.3 decides that).
-
Project window → the polish pass → pick two from the list below and no
more:
- Ladder edges: at the very bottom of the climb, restore a moment of gravity so the player settles onto the floor instead of hanging in the air when the zone ends.
- Ladders through one-way ledges: if you built a one-way platform in 7.2, a climb can pass up through the cap. Test it and write down what happens.
- The re-entry repair from 7.3: if you chose the cooldown, time its length with a stopwatch rather than by feel.
- Sound: one soft tick per tile climbed — a candidate to note, not work for today.
IsWalking, WalkDir and Attack parameters from
Unit 1. There is no climb state, no climb clip, and
no climbing pose in any sprite sheet that ships with this project
— check Assets/Artwork/Character/Player/ to confirm that yourself.
If you did want one later, the climb-specific work is short: draw or license climbing frames (art, not code, and the step that stops most students), then add two states and a Bool parameter to the controller and drive that Bool from the same flag your zone already writes. Decide the Up/Down question on the way: one climb pose mirrored, or two. None of it is today's work, and none of it belongs to a mechanic that already works — it belongs to 7.7's polish pass or to Unit 8.
Socratic: Who Decides Where the Climb Ends?
- Which of the three answers does your build currently have — by accident, not by choice? Say what the player sees at the top tile right now.
- Option three costs no code and option one costs a per-frame physics question. Which teaches the player more about your game's rules, and which is easier to explain to a tester?
- If you cap the ladder, the last step is a jump. What must be true about the height between the cap and the ledge above it, and which numbers from 6.1 decide it?
Checkpoint — before moving on, you must be able to:
- Explain the top-of-ladder problem and name the three classic answers with a cost for each
- Say which answer you built, and why it fits your level
- Reuse your 6.2 ground check to end the climb, and explain why the reach had to change
- Defend your mount rule and your prompt decision — including choosing no prompt
- State honestly that this project ships no climb frames, and list what adding one would involve
- Break this task into parts small enough to look each one up on its own, and say in one line what each part does
- Say which earlier lesson each part of this task came from, and where you would reread it
- Commit and push
Reference Docs
Need a deeper explanation? These pages cover the same concepts:
- Unit 7: Level Building & Ladders
- Unit 6: Jumping — the ground check you are reusing
- Unity + C# Quick Reference — Animator parameters and 2D physics queries
Saved on this device only — the Dashboard tracks your progress.