Hi, In my game when a player presses the right mouse button in scene 0, I want scene 1 to load. (and the mouse button is kept down).
When the mouse button is released in scene 1, I want scene 0 to load again.
The first switch is easy enough - but I just can’t get the switch back working.
It seems that unity doesn’t store which key has been pressed between scenes, so when I use
if (Input.GetMouseButtonUp(1))
in scene 1 to load scene 0 again nothing happens.
I tried attaching a script to a gameobject which isn’t destroyed between scenes and wrote this
function Update () {
if (Input.GetMouseButtonDown(1))
{
Debug.Log ("mousedown");
}
if (Input.GetMouseButtonUp(1))
{
Debug.Log ("mouseup");
}
}
To see if anything would show on the console - but it isn’t recognising that the mouse button is released.
Does anyone know how I would go about doing this?
Would it be possible to simulate the right mouse button down at the start of scene 1 in code so when it is released this is recognised - or is what I’m trying to do really not possible?
Best, Laurien