Module 1 · In Studio · challenge 3 of 3 in this lesson

inRange, flatDirection, isFacing, chaseStep and lerp in challenges/work/math_3d.luau return the right values

A test in Studio grades it and prints a pass code.

Open

Level 3, Professional

Challenge

Optional Studio stretch challenge: start from m14-ship and fill in the five functions in challenges/work/math_3d.luau. The : Vector3 and : number labels in that file are type annotations taught at the end of Module 2. The check is pure math. Press Play to start the Course Runner, then run this in the server command bar:

luau
game.ServerScriptService.RunGameTests:Invoke("math-3d")
Start from
The game at milestone m14 (download)
Grade it
In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("math-3d") in the server command bar. Copy the pass code from Output.

Done means

  • inRange, flatDirection, isFacing, chaseStep and lerp in challenges/work/math_3d.luau return the right values
  • flatDirection returns nil for points on top of each other instead of NaN
  • chaseStep stops 3 studs short and keeps the drone's own height

The Course Runner prints this code when the test passes.