Search Unity

Pause Controller [ Released ]: Group Pausing without timeScale = 0

Discussion in 'Assets and Asset Store' started by ElecktMobileDrey, May 15, 2012.

  1. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Hi Everyone,

    I'll like to introduce EleckTek's first tool, Pause Controller.
    Here's some key features and benefits:
    • It saves you time!
    • Pause a particular GameObject or a group of them. There's many filtering options through interface that will exactly define what needs to keep going and what needs to stop.
    • No need to use timeScale = 0. This will allow code to be written more naturally and have more components from other packages work without any or much involvement.
    • Handles each component intelligently (knows not to affect particular components. This can also be updated through the api and interface)
    • Works great for RPGs or Strategy games where turn-base combat or combat freezing is required.
    • There's options to keep particular MonoBehaviour running even if the GameObject is paused.
    • Integrates with playMaker beautifully. playMaker needs special treatment to really work as expected. PauseController is aware of that and handles playMaker as well. It also comes with an action to get you going without using generalized playMaker actions or coding a new one.
    • Clean dynamic interfaces.

    Intro Tutorial Video!






    Check out our interactive demo

    Come visit our website!

    Asset store link!

    Here's the store description:

    Pause Controller is the quickest and most flexible way to pause your game in Unity3d. With Pause Controller, you can avoid using Time.scaleTime and all the problems that come along with it. These means that more Unity packages can work without special coding, allow any GUI system to shine! The setup is quick and you're ready to go!

    Visual Scripting users:
    The Pause Controller interface enables a variety of GameObject attribute combinations that gives full control over what's being pause and what isn't. It works with all packages, just set "activatePause" to true and all things in the scene will stop. Comes with playMaker action to ease the process.

    Coders:
    There's API that gives more control over how things get pause and which things should always stay running. There's a Programmers Guide that's online and include with the package.

    We want your feedback. We worked hard on making PauseController painless to integrate. We want users to focus on their GUI and gamesystem code and not be concerned with how to pause them.
     
    Last edited: Jun 14, 2012
  2. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Youtube tutorial videos and examples are coming up soon.

    If you aren't interested in Pause Controller, please explain why and I'll love to address it. No matter the state of your project, you can integrate Pause Controller within 2 mins or else I'll figure out a way to make it happen.
     
  3. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    I read the info on your website and i'm very interested.
    Will be getting it as soon as i get home!

    PS: i'm a designer and a PlayMaker user, to be honest the PM complatible logo convinced me :)
     
  4. ShreddinPB

    ShreddinPB

    Joined:
    Aug 18, 2011
    Posts:
    79
    Hi there, I purchased Pause Controller because I was having issues with playmaker animations and setting time scale. After I import pause controller I get an error. It seems that it and NGUI have a script that is named the same..

    They are both in the examples directory so I'll probably just get rid of them.. both ;)
     
    Last edited: May 17, 2012
  5. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Sounds good. I'm working on an update. I'll be sure to give it an unique name. How are u enjoying it?
     
  6. ShreddinPB

    ShreddinPB

    Joined:
    Aug 18, 2011
    Posts:
    79
    Just started getting it going, so far its painless.
    Honestly at first I wasnt going to buy it since I had already written a pause function for my game that was working decent, everything except for animations in playmaker (made a post in playmaker forums but nothing). But now I kinda wish I had had it from the beginning cause 10$ is worth my time not spent writing it ;)

    Im about to add the playmaker side now and then I'll let you know ;)
     
  7. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    @clandestine: thanks for looking into it. We are using playMaker too and we knew other users of it maybe interested in it.

    @ShreeddinPB: yeah, i hear you. It started out as a test to get around timeScale = 0 and I was encouraged to make it a full-on asset for sale.

    I'll probably push the update late Friday, so if you have any ideas or request, I'll try to get it in before that upload.
     
  8. ShreddinPB

    ShreddinPB

    Joined:
    Aug 18, 2011
    Posts:
    79
    Hey, so thinking that it is playmaker friendly, I was looking for a pause "action" but dont see one, so to use it with playmaker I Just "Invoke Method" and pause it that way?
     
  9. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    There's a folder called playMakerSupport. Inside there's a playMakerSupport package. Once you open it, you'll see the action come up. Also, you must drag the "PlayMakerFsmPause" over to a GameObject. That should get you going.

    I had to do this to avoid compiling errors if someone didn't have playMaker.
     
  10. nilton_felicio

    nilton_felicio

    Joined:
    May 17, 2012
    Posts:
    66
    Controller Pause effect is possible to create "bullet time" or "slow motion", as in the game FEAR?
     
  11. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Sorry Nilton_felico, not right now. Honestly, I wanted to take it that far but we have a game to make. That's a much tougher problem to get working in "groups" as well.
     
  12. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    The next update will include a slightly updated Action for playMaker.

    Also it will include a KeyPress Detector component to get pause working right out the box.

    After these things are done, I'll be making a youtube video tutorial.
     
  13. ShreddinPB

    ShreddinPB

    Joined:
    Aug 18, 2011
    Posts:
    79
    Yeah I had done that, I just couldnt find the action in playmaker. I was thinking it would be under its own action group like "Pause Controller" or something like that, you put it under "Time" ;) guess I coulda used the search function in the playmaker actions menu :(
     
  14. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Yeah, i was debating about that. All good now?
     
  15. ShreddinPB

    ShreddinPB

    Joined:
    Aug 18, 2011
    Posts:
    79
    Is Pause controller switching things from kinematic to non kinematic?

    All of my Game Objects are set Kinematic = true except for one, after I pause then unpause, they are all set to Kinematic = false and things start bouncing around everywhere.

    Simplest test I could do..
    start game
    select item check its set correctly, it is (Kinematic = true)
    select the pause controller click "Activate Pause" to set it true
    click "Activate Pause" to set it false
    select the same item as before check its set correctly, it is not (Kinematic = false)
     
  16. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Ah, got it. Testing the fix, i'll push this ASAP.
     
  17. ShreddinPB

    ShreddinPB

    Joined:
    Aug 18, 2011
    Posts:
    79
    Awesome man thanks!
     
  18. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Just pushed the update, awaiting approval. Thanks for your patience. ^^
     
  19. ShreddinPB

    ShreddinPB

    Joined:
    Aug 18, 2011
    Posts:
    79
    The quickness of your response and fixing this are worth the $10 alone.. thanks!
     
  20. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Awesome. EleckTek loves Customer Service. Seems like the store has the update now. You can post in this thread or use the contact page http://elecktek.blogspot.com/p/contact.html if anything else comes up or you have any questions.
     
  21. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Hey guys, after you have a good run with it and you don't feel it deservers 5 star rating. Tell me what's missing and we'll see what we can do. Otherwise, a rating would be much appreciated! ^^
     
  22. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    Purchased! Will test as soon as i get a chance!

    Thanks!
     
  23. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    I happen to be up at this crazy hour. Thanks! I'll be busy today but checking the forum. If an update needs to happen, I can work on it Saturday afternoon.
     
  24. ShreddinPB

    ShreddinPB

    Joined:
    Aug 18, 2011
    Posts:
    79
    Hey there, I am running into something else.. dont know if its how I have things setup or what.

    My game piece has a playmaker state machine attached to it, its a pretty simple one.
    I have another state machine that is for the whole game, this one reacts as expected, but the one that is on the game pieces does not.

    The FSM on the individual game pieces will reset back to their start state after resuming from a pause. So the game piece is in a state waiting for a collision, but then after the pause is released, its at its default state and no longer looking for collisions.
    I can find a way around this and fix it in script, but I dont think this is how its supposed to work right?

    I tried adding a PlaymakerFSM Pause script to that object also but it didnt seem to help things.
    I also notice that all the game pieces blink when I un pause. I think this may be due to the fact that the pieces are spawned (pool manager) at a size of 1 then instantly set to the size they are supposed to be at (15 in this case)
     
  25. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    The thing I had to do today got push til tomorrow. I'm checking it out right now.
     
  26. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Testing the formal fix. Will push it today. There's a "Reset on Disable" filed on the FSMcomponent. If it's set to true, set it to false and see if that helps you for now.
     
  27. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Just submit the fix. If the updated can't come out by today, email me through the company site and i'll give you more instructions.
     
  28. ShreddinPB

    ShreddinPB

    Joined:
    Aug 18, 2011
    Posts:
    79
    You are rocking with the updates ;)
    Checking "Reset on Disable" fixes it also!
    Dont need to bug you more on it as it works fine with just setting that on the game piece, and I cant think of why I wouldnt want it set like that anyways ;)
     
  29. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Yeah, while the "Reset on Disable" option is an edge case, people can solve problems in all sorts of way. That's why we tried to provide many options and features for PauseController. And this is what we mean by transparent tools. There's a features update coming soon. Then after, youtube videos. If you're enjoying using PauseController, please spread the word to whomever else it can help.

    By the way, you're enthusiasm is very heart warming and encouraging to us. We are planning our next tool now :).
     
  30. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Hey Everyone, just made a tutorial video and new features for Pause Controller. Check it out, don't forget to contact me if you don't feel it deservers a 5 star rating.
     
  31. mysterben

    mysterben

    Joined:
    Jun 19, 2012
    Posts:
    7
    Hi there,

    Run into a problem using this with unity playmaker. It crashes the game and I get the following error if it pauses while in a state playing a random sound:

    MissingReferenceException: The object of type 'AudioSource' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    EleckTek.PauseTypes.BehaviourPauseInterpreter.SendMessage (System.String message, PauseMessageParameter parameter, SendMessageOptions options) (at /Users/Dreyton/TestPauseController/Assets/PauseComponents/PauseTypes.cs:194)
    EleckTek.PauseController.UnpauseIndividualListing (PausingListing pausing_listing) (at /Users/Dreyton/TestPauseController/Assets/PauseComponents/PauseController.cs:494)
    EleckTek.PauseTypes.PausingListing.Unpause () (at /Users/Dreyton/TestPauseController/Assets/PauseComponents/PauseTypes.cs:663)
    EleckTek.PauseController.DeactivatePauseProtocol () (at /Users/Dreyton/TestPauseController/Assets/PauseComponents/PauseController.cs:731)
    EleckTek.PauseController.LateUpdate () (at /Users/Dreyton/TestPauseController/Assets/PauseComponents/PauseController.cs:690)
     
  32. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    I'll get right on that. Thanks for the post!
     
  33. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Hey Smiff, i've sending you some private messages.
     
  34. mrbdrm

    mrbdrm

    Joined:
    Mar 22, 2009
    Posts:
    510
    hello
    i have a major problem , after i importing the files my layers are all gone exept the default ones :(
     
  35. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Hopefully you have a backup copy, reimport pause controller and you'll see "PauseController/Example/ProjectSettings" folder in the import menu. Uncheck that box then, reimport.

    I'm making a new upload with this fix and a temp patch( an add-on component ) for your problem smiff. This patch will be using the PauseController API to fix the problem ( meaning no new DLL recompile for now ). It should be online monday.

    Sorry about all this, somehow my folders got mixed up and I have to sort out why the DLLs won't compile correctly and stupid things like how the ProjectSettings folder became included. I'm working on all these things, the timing is just bad right now. It's coming though guys, I won't leave you hanging!

    Thanks for the investment, you won't regret it!
     
  36. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Dll stuff fixed up ( no patch required ).

    Version 1.03 just submited. It'll probably be available tomorrow. Let me know if it takes care of you guys.
     
    Last edited: Jun 25, 2012
  37. mysterben

    mysterben

    Joined:
    Jun 19, 2012
    Posts:
    7
    Hi Drey,

    Thanks for your hard work on resolving our issues, much appreciated.
    I have a question but I'm not sure how related it is to Pause controller. Basically on our android game if the device is interrupted, by for example the player receiving a phone call or hitting the home button Unity automatically pauses the whole game (I believe with OnApplicationPause) and resumes once the game is re-entered. Trouble is our publisher is asking that it resumes paused back into the pause menu, but I use your system for that. My question is, is there any way of calling your pause either instead of or as well as the global one so the game can enter the menu?

    Regards,
    Matt
     
  38. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Not yet purchased.
    I find this very interesting for one of my small projects. though in that small project I need something very specific:
    Is there the ability (or possibility) for slowdown till pause and vica versa (pause to normal speedup)?
    Hope you know what I mean :p
    Thanks in advance.
     
  39. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    I would like to include some scripts on my camera like follow player and exclude an image filter for color correction on the camera.

    Is there a easy way to achieve this? Because at the moment my camera looses the color correction at pause and so looks different when I pause the game.
     
  40. ElecktMobileDrey

    ElecktMobileDrey

    Joined:
    May 15, 2012
    Posts:
    31
    Wow, i'm in China right now and I odds are I won't have internet access until August 5th., I'm glad it worked out this morning.

    Thanks for inquiring on different aspects of pause controller. I hope it's really helping you all out.

    I want to point out the documentation that comes along with pause controller. I worked pretty hard on the API to really allow more flexibility. If you haven't looked over it yet, be sure to. It might help answer questions.

    mysterben:
    If you are using the InputHelper, change the source code.

    Otherwise, I think using PauseController.activatePause = true will do the trick for you on "OnApplicationPause".

    nuverian:
    Yes you can do this, You just need to make a script that slows the game down, then activates pause controller ( PauseController.activatePause = true ). At that point, you can set you scaleTime back to 1 for any purpose you have while everything else is paused.


    Lars Steenhoff:
    There's a method called "InsertPauseTypeBlockSucessful" in PauseController. Just pass the type using "typeof( <YourType> )" to the method and you should be set.

    Sorry, I have to go now. Please look at the Docs. I know they're not perfect but they should help.
    加油!( "Jia you" Mandarin for "go for it" or "work hard" ).
     
  41. mysterben

    mysterben

    Joined:
    Jun 19, 2012
    Posts:
    7
    Yeah it did the trick, one of the Playmaker guys helped me out by writing an action that listened for OnApplicationPause.
     
  42. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Hi Mysterben would you mind sharing this playmaker action? thanks
     
  43. mrbdrm

    mrbdrm

    Joined:
    Mar 22, 2009
    Posts:
    510
    im having troubles hiding the mouse and pausing , if i did that the mouse pointer will flicker , i must check the option every frame but i want to know if i do that will it effect my frame rate ?
    btw im using playmaker
     
  44. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    I have the color correction script excluded, see image example. thanks.
     

    Attached Files:

  45. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    One thing I have problem with is that when I press pause the player still moves one frame froward when the rest has already stopped, Im using physics to move the player with a smooth follow cam script on the camera.

    Any idea where to look to fix this?
     
    Last edited: Jul 21, 2012
  46. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    How do I keep the lens flare on the camera active at pause?
     
  47. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    And how do I keep the GUI layer on the camera active on pause?
     
  48. mysterben

    mysterben

    Joined:
    Jun 19, 2012
    Posts:
    7
  49. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Thanks I have been able to exclude the camera by layer and then include the scripts by behaviour.

    The only thing I can't do is to have sone behaviour pause and the others not pause.
    I would love to see a way to have both options in the same pause controller active.
    At the moment it's only possible have to select one choice.
     
  50. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    on an iPhone 3gs it takes two seconds before the games pauses after input, not sure why this is any ideas?
    on ipad 3 it's fine