Answer the question
In order to leave comments, you need to log in
How to make Checkpoint in Unity?
Hello!
I want to implement the Checkpoint system in a Unity2D project. It is necessary that when the Player enters the Checkpoint's coverage area, the player's position is saved and when the scene is reloaded, the player appears at the position that the Checkpoint saved. There are guides on this topic on YouTube, but not one of them works in my project.
PS Does the save system depend on the player's script or not?
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
You make an empty object with a trigger collider, throw a script on it, in which ontriggerenter2d checks whether it is a player and already through other.getcomponen().SetCheckpoint(transform.position) you set the player’s position
to save position use https://docs.unity3d.com/ScriptReference/PlayerPre...
transform.position convert to json string and save it PlayerPrefs.SetString
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question