Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by amrit88 · Jul 25, 2011 at 12:51 AM · pausecamera.main

How to pause the main camera ?

Would anyone have any idea how to pause ( not disable) the main camera view ? I have used the timescale (Time.timeScale = 0; ) Class Variables, which only disables the first person control along with other game object in the scene.

The reason why I would like to pause the main camera is because; I do not wish to see any movement when the pause menu GUI is visable.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by SilverTabby · Jul 25, 2011 at 01:57 AM

I would simply pause the game with Time.timeScale = 0, and then do the following commands to Camera.main:

  • Save the Camera's CullingMask into a variable.

  • Save the Camera's ClearFlags into a varible.

  • Set the Camera's ClearFlags to Nothing. This will make it so that the previous frame's image will not be cleared.

  • Set the Camer'as Culling Mask to 0. This makes it so that NOTHING is rendered.

  • The Camera should now display the image of the previous frame permanently.

  • When the game is unpaused, reset the CullingMask and ClearFlags values to what they were before.

Also, when you setup a script to do this, DO NOT use Update or LateUpdate to perform these tasks because they will not be called if the game is paused.

     Hope this helped <("<)(^"^)(>")>

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image amrit88 · Jul 25, 2011 at 12:02 PM 0
Share

Thanks $$anonymous$$ate, this has solved my problem

avatar image
0

Answer by Elecman · Feb 07, 2014 at 05:52 AM

This doesn't work on some mobile devices. For a proper solution, please vote for this: http://feedback.unity3d.com/suggestions/manually-activated-render-loop-for-lower-power-consumption-on-mobile http://feedback.unity3d.com/suggestions/realtime-input-framerate-indepe

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by virginiaelizabethgil · Feb 14, 2019 at 07:53 PM

Hello, sorry to reopen this issue so many years after this was solved, I'm having a similar problem with my game and haven't been able to find a solution. I want to completely pause a camera's rendering, and this solution -setting culling mask to 0 and clear flags to nothing- works well except for one detail: when I move the mouse over the area that is paused it leaves a trail behind that will only get cleaned up when the camera is unpaused and its clear flags are reset. From what I understand, this seems to be happening because since the clear flags are set to Nothing, literally nothing will be cleared from the screen. It doesn't seem to be possible to set the flags to the clear the mouse movement only.

This question is a few years old, so I was wondering if perhaps anything been added to Unity that could help me solve this problem. Or is there some other workaround I'm missing?

Thanks in advance for any information!

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jstopyraIGG · Feb 15, 2019 at 02:04 AM 0
Share

You might try changing mouse cursor to an empty image maybe? https://docs.unity3d.com/ScriptReference/Cursor.SetCursor.html Just make sure that you figure out the base cursor texture, and rect, so you can reset it back to normal

avatar image virginiaelizabethgil jstopyraIGG · Feb 18, 2019 at 06:34 PM 0
Share

Hello, thanks for answering! I ended up doing something else: since what I wanted to pause was essentially my 2D background, I separated one camera for the background and one camera for the UI from my main camera. I find that this allows me to save up on update operations, at least in my specific case. Your suggestion however sounds clever and could have been a legit alternative. Thanks again for your time.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can't use camera.main [SOLVED] 1 Answer

Coroutines, WaitForSeconds with function Update? 3 Answers

Main Menu in different scene - pause game 3 Answers

Pause at end of game 2 Answers

Xbox controller not responding correctly with timescale set to 0 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges