- Home /
Orbit camer while paused?
I have a pause menu for when i press escape and it freezes the time.scale but the camera continues to orbit and so the direction is weird when i un-pause it so i was trying to do this...
function PauseGame() { savedTimeScale = Time.timeScale; Screen.lockCursor = false; guiTexture.enabled = true;
// i add the line directly below this to try and disable the camera orbit but it
// did not work. do you know a way i can put a line in that would do what that?
transform.Find("Camera").OrbitCamera = false;
Time.timeScale = 0;
AudioListener.pause = true;
if (pauseFilter) pauseFilter.enabled = true;
currentPage = Page.Main;
}
Answer by KeithK · Apr 03, 2011 at 07:07 AM
When you set timeScale to 0, the update of all objects is still being called. So anything you're moving by a fixed value not affected by time, is still going to carry on happening.
To get your camera to stop orbiting you could:
1) Change your rotation script to use deltaTime, or
2) Check in your Camera's Update if timeScale == 0 and bail out.
Your answer
Follow this Question
Related Questions
Dramatic Camera effect with all physical gameobjects paused? 0 Answers
How to pause only specific objects/prefabs? 3 Answers
How can i pause gradually from timeScale 1.0 to 0.0 over a second? 1 Answer
OnMouseDown on what? Camera Movement Help. 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers