Checkpoints
Checkpoints are very important, as they let the player to start from a certain point in the level, rather than forcing to restart from start. However, they require a certain configuration in order to work properly and can bre confusing at a first glance. In this page you will learn how to properly set them up.
There are 2 types of checkpoints: Non-Reusable and Reusable. Reusable checkpoints can be used multiple times(for example: 4-2). Checkpoints can be found in ULTRAKILL Assets/Prefabs/Level/(Checkpoint.prefab or CheckpointReuseable.prefab)
Setup
Here, a big part of the checkpoint settings will be skipped since they are rarely used. Instead, we will focus on the most used and required settings.
- To Activate: Any object that is placed in that field will be activated when the checkpoint is hit. This is usually used for activating rooms that were disabled for optimization purposes, however, you can use it for more advanced level logic.
- Rooms To Inherit: Everything in
Rooms To Inheritis saved when the checkpoint is hit. Use this for... most stuff, really.. - Rooms: Everything in Rooms is saved immediately upon level load. Use this for stuff that can't possibly be affected before hitting the checkpoint. Reusable checkpoints likely won't make much use of Rooms.\
- Doors To Unlock: Unlocks doors after the player respawns. Set
Doors To Unlockto unlock any doors to enemy arenas where you could have reloaded the checkpoint. Otherwise, the player won't be able to get back to the arena(or any other place of death).
For Rooms To Inherit, it is recommended to use only Stuff, as placing the whole room in there will not deactivate enemies that are in these rooms. If your room does not have any enemies inside, it is safe to put the whole room in the field.
Now, when the checkpoint is hit and player dies, it will reset the wave and the room will stay.
Functionality
Here, is a more technical documentation of what Checkpoints are capable of doing.
- Force Off
- Forcefully turns the checkpoint off.
- Ideal to use this over just deactivating the checkpoint, as it can break checkpoints otherwise if 2 reset the same object.
- Use the
SetForceOff()event to turn this on/off on runtime.
- Rooms
- List of objects to be reset on the level being loaded.
- Rooms To Inherit
- List of objects to be reset on the checkpoint being hit.
Wrong placement of an object between Rooms and Rooms To Inherit is an easy way to cause a Sequence Break in a level, where you can trigger certain events under conditions that aren't intended. Think about what you're resetting and how it can be abused by passing through the checkpoint at the wrong time(or not at all).
References to objects in Rooms and Rooms To Inherit will break because the checkpoint activates clones of them on runtime. The Arena Status script can solve issues between static/nonstuff -> gorezone.
- Doors To Unlock
- List of objects with
Doorscript to be unlocked on respawn.
- List of objects with
- Multi Use
- Regenerates the checkpoint after going through it (Use the
CheckpointReusableprefab).
- Regenerates the checkpoint after going through it (Use the
- Dont Auto Reset
- Prevents the checkpoint from immediately activating(in cases where you'd want to call the
ResetRoom()andInheritRoom()events manually).
- Prevents the checkpoint from immediately activating(in cases where you'd want to call the
- Start Off
- Checkpoint object is deactivated on scene load.
- Unteleportable
- Removes checkpoint from list of checkpoints to teleport to in the cheats menu.
- Invisible
- Hides checkpoint graphic.
- Can be toggled on runtime with
SetForceOff()event.
- On Restart()
- List of UnityEvents to be called when the player respawns.
Checkpoints can only be parented to empty objects at 0,0,0 position.
Pitfalls
Checkpoints can break if they dont have the following:
- Object in `To Activate:
- There must be a gorezone on your object.
- Object in
RoomsORRooms to Inherit:- There must be gorezones on each of your objects in
RoomsorRooms to Inherit. - Objects cannot contain other checkpoints in them.
- There must be gorezones on each of your objects in
In some cases, having static flags on an object that gets reset can cause issues with the checkpoint. Generally, if an object has static flags, it shouldn't be changing and need to be reset in the first place.