I've had a look around and kept finding about using Time.TimeScale = 0 to pause the game, although this is the normal way to do it, it is not exactly what im looking for.
When my menu button is pressed I have a texture which is instantiated and slides onto screen from the left side and therefore does not work with Time.TimeScale because the menu just stays hidden off scren.
Is there a way to have the game pause but still allow for this menu to slide onto screen?
Edit -
How I spawn in the Menu prefab (Within GameController Script):
public void MenuPressed ()
{
Vector3 newPosition = new Vector3 (-13, -0.06f, -2);
Quaternion newRotation = Quaternion.Euler (0, 0, 0);
Instantiate (menu, newPosition, newRotation);
menuButton.SetActive (false);
textFrame.SetActive (true);
}
How I move the Menu (Within MenuMover Script):
void Start()
{
rb = GetComponent<Rigidbody> ();
rb.velocity = transform.right * speed;
}
void OnTriggerEnter (Collider other)
{
if (other.tag == "MenuBoundary")
{
rb.velocity = Vector3.zero;
}
}
}
rb.velocity = transform.right * speed\$\endgroup\$