pausing and GUI

Hi Everyone,

I have created a GUITexture called “PausedGUI”. I have attached a script to it that moves from off screen to the right side of the screen (See image).

However when I pause the game, the PausedGUI doesn’t move. I made it so that when paused = true, time.timescale = 0. This is to stop all of my enemy prefabs and some other things to stop moving.

Is there any way I can make the PausedGUI move to the place I want it to while time.timescale = 0? I know the problem is that time.timescale = 0 and am looking for a way to resolve this.

I have attached an image to illustrate what it is I am looking for.

Thanks
Nima

I tried setting the time.timescale to a really low number like 0.001 and multiplying that back onto the object I want moved but it doesn’t allow for a smooth transition…Just incase anyone was going to suggest that.

Managed to solve it. Based on pause Time.timescale = 0.01f

public class MoveHorizontal : MonoBehaviour {

private float maxAlongX = 0.809f;
private bool max;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

if (GameObject.Find (“GameAttribute”).GetComponent ().paused == true max == false) {
Debug.Log(“paused condition met for pauseGUI”);
// Vector3 moveLeft = new Vector3 (-1, 0, 0);
float translation = Time.deltaTime * 10;
transform.Translate(-0.05f, 0, translation);

}

if (transform.position.x <= maxAlongX) {
max = true;
print (“max is true”);
}

if (max) {
if (transform.position.x == maxAlongX) {
transform.Translate (0f, 0f, 0f);
}
}
}
}

NGUI solves this by making its own timer called “realTime” that works off of Time.realTimeSinceStartup and uses that for GUI instead of Time.deltaTime. That way you can have your GUI work at the same speed even if you change the game timer to do slo-mo, pausing, or fast forward.