Skip to content

PlayerViewEndedPayload

What playerViewEnded gets: the payload a handler receives.

type PlayerViewEndedPayload = {
player: PlayerSnapshot; mode: "camera" | "spectating" | "freecam"; target: CameraTarget | SpectateTarget | null;
endReason: PlayerViewEndReason;
};
Field Type Description
player PlayerSnapshot The player whose view ended.
mode "camera" | "spectating" | "freecam" A camera view, spectating, or a freecam.
target CameraTarget | SpectateTarget | null What they watched; null for a fixed camera or a freecam.
endReason PlayerViewEndReason Why it ended. Renamed in 0.28 from reason.