playMaker

Author Topic: Pause button.  (Read 2928 times)

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • Permaximum Betty
Pause button.
« on: August 06, 2011, 10:20:18 AM »
Well I got a new little problem
Like all know by now im change all my code that I had under GUI buttons to playmakers Gui Button.
The problem I have now is with this code:

Code: [Select]
if (UnityEngine.GUI.Button (Rect (Screen.width / 2 - -125,20,55,25), "Pause"))
{
if (Time.timeScale == 1.0)
{
        Time.timeScale = 0.0;           
        }
        else
        {
        Time.timeScale = 1.0;
}
}

What it does is when I press the button it will check if the game is paused or not.
Works without problem, but its Unity3d gui button the code is on and that dont work good..
So I need an FSM that do this.
I did try to make one but every time I set the timeScale to 0 then the state also freeze.
So basically the FSM is also halted.
But it should only be the game that is halted, not the GUI.
It does work without any problem that way with Unity3D, but not with a FSM.
So how do I get this to work?
Or is it an other way to pause the game?

 

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Pause button.
« Reply #1 on: August 06, 2011, 11:34:57 AM »
Did you try the Time Actions in pM?

I have no idea how it works with having FSMs still running etc.

Q

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • Permaximum Betty
Re: Pause button.
« Reply #2 on: August 06, 2011, 11:57:40 AM »
Did you try the Time Actions in pM?

I have no idea how it works with having FSMs still running etc.

Q

I did solve it. The playmaker did crash again and when i did reload it then it did work. lol.