ActionContext
Handed to every action when its step becomes active, and to every callback that action takes.
It is how an action reaches the shared guidance tools and how it ends the step. An action never talks to the Tutorial object directly, which is what lets the same action be reused across tutorials.
FocusUI.to(shopButton, {
Clicked = function(context)
if playerHasEnoughCoins() then
context:Advance()
else
context.Pointer:PointTo(coinChest)
end
end,
})
Properties
Step
This item is read only and cannot be modified. Read OnlyActionContext.Step: numberOrder number of the step this action belongs to.
Janitor
This item is read only and cannot be modified. Read OnlyActionContext.Janitor: JanitorCleanup scope for the step, not for the action.
Everything you register here is destroyed the moment the step ends, which is why an action never has to undo its own work and why no step inherits leftovers from the one before it.
Custom.new(function(context)
const connection = someSignal:Connect(onFired)
context.Janitor:add(connection, "Disconnect")
end)
Spotlight
This item is read only and cannot be modified. Read OnlyActionContext.Spotlight: SpotlightThe dim overlay, shared by every step of this tutorial.
Pointer
This item is read only and cannot be modified. Read OnlyActionContext.Pointer: WorldPointerThe world guidance, shared by every step of this tutorial.
Camera
This item is read only and cannot be modified. Read OnlyActionContext.Camera: CameraTourThe cinematic camera, shared by every step of this tutorial.
Functions
Advance
ActionContext:Advance() → ()Ends this step and opens the next one, or completes the tutorial if this was the last.
This is what Advance = true expands to. Call it directly when the decision needs a condition
the kit cannot know about.
Complete
ActionContext:Complete() → ()Ends the whole tutorial from inside a step.
GoTo
ActionContext:GoTo(step: number--
Order number to jump to
) → ()Jumps to any step, which is how you branch.
Dialog.new({
Lines = { "Have you played before?" },
Choices = {
{ Text = "First time", Advance = true },
{ Text = "Skip ahead", GoTo = 12 },
},
})