Checkpoints
Prefab found at Assets/ULTRAKILL Assets/Prefabs/Levels/ Checkpoint & CheckpointReusable
Checkpoints allow a player to start over an arena or segment, but how does this work internally?
A Checkpoint is given Stuff to clone, and when the player resets to a Checkpoint, it restores what was cloned.
It is also important to know that: if the Checkpoint spits you into the void, you did something wrong!
Basic Usage
Out of the box, Checkpoints need little setup:
To Activate- the room object the Checkpoint is for. Think of it as the room object that is enabled if you were to teleport to it through the Teleport Menu cheat.Rooms- a list of Stuff that is cloned when the level loads, saving the default state of Stuff.Rooms To Inherit- a list of Stuff that is cloned when the Checkpoint is grabbed, saving the state of Stuff when it's grabbed.Doors To Unlock- doors that will be unlocked when the player restarts to this Checkpoint. Usually, if an arena locks doors found in Stuff, put those doors here as well, or else you'll get stuck.
If your Checkpoint is non-reusable (one time), put your Stuff in Rooms!
If your Checkpoint is reusable (multi-use), put your Stuff in Rooms To Inherit!
Between Rooms and Rooms To Inherit, you only need to fill one of those in, never both.
It is important that you only put Stuff objects (the ones with the GoreZone component) into either Rooms or Rooms To Inherit depending on your use case. Putting other objects without the GoreZone component may cause issues.
In your level hierarchy, Checkpoints should always split between rooms.
- 1 - MyRoomFirst
- Checkpoint (would clone Stuff found under MyRoomSecond)
- 2 - MyRoomSecond
The Checkpoint's local +Z direction is where the player will be facing when respawned.
Troubleshooting
Checkpoints are very tempermental, but here are some pointers if you're having issues!
- Is your Checkpoint separate from any room in the hierarchy?
- Is
ToActivatefilled in? - Is there at least 1 Stuff object in either
RoomsorRoomsToInherit? - Are there not Stuff objects in both
RoomsandRoomsToInherit?- If there is (and you know what you're doing), are they not the same Stuff?
- Are there no missing references in either the
RoomsorRoomsToInheritlists?
Fields
Inherit All Rooms- this treats everyGoreZone(Stuff) in the level as if it was underRooms To InheritUnlock All Doors- this treats everyDoorin the level as if it was underDoors To UnlockDoors To Ignore- when unlocking doors with specificallyUnlock All Doorsset to true, do not unlock these doorsReset On Get Other Checkpoint- if another Checkpoint is grabbed, re-enable this Checkpoint to be grabbable (even if it's non-reusable!)Reset On Distance- usingAuto Reset Distance, re-enable this Checkpoint if the player has exceeded that distanceStart Off- sets the Checkpoint to a state as if it was grabbedForce Off- overrides all logic of this Checkpoint being able to be re-enabled (Reset On Get Other Checkpoint,Reset On Distance, etc.), and has to be set on manually viaSetForceOff(bool state)functionDisable During Combat- disallows this Checkpoint to be grabbable if combat is activeUnteleportable- remove this Checkpoint from the Teleport Menu cheat listInvisible- hides the pink graphic, but the Checkpoint is still grabbableOnRestart()- a list of UnityEvents to be called when the player resets to this Checkpoint