Help with Checkpoint (C#)
So, i'm trying to make a not-that-simple checkpoint system.
I have already done something, but I want to make just one script for it.
The thing is:
void OnTriggerEnter (Colider col)
{
if (col.gameObject.tag == "Checkpoint")
{
//Save the scene as another called "Checkpoint"
}
}
void Update ()
{
if (Input.GetKeyDown (KeyCode.R))
{
//SceneMaganer.LoadScene ("Checkpoint");
}
}
Or something like that...
//Sorry for my English :)
Answer by $$anonymous$$ · Jul 25, 2016 at 01:46 AM
If you trigger the Checkpoint then a new Scene will be created and that scene must be equal to the actual scene. That one will be called "Checkpoint". If you press R (or whatever key designated for the checkpoint activation) the checkpoint scene must be loaded.
The problem I have is: I don't know how to create a new Scene that's almost the same as the actual but with the data of the actual.
Otherwise, I've tried to create a text file with all the variables (with positions and stuff) and then when pressing the designated key for the checkpoint activation replace the actual variable values with the ones on the text file.
Hope you undertand.
Your answer
Follow this Question
Related Questions
Help with a door slam trap 0 Answers
Any way to fix an tag change problem? 1 Answer
C# access a generic list from another controller -1 Answers
OnTriggerEnter/Exit Rapid Firing? 0 Answers
1 Restart Scene multiple levels. Is this possible? - C# - 1 Answer