Quantcast
Viewing all articles
Browse latest Browse all 112

Time.timeScale and Time.fixedDeltaTime

I'm making a quick menu for my game, when it pops up the game time slows down to 10% normal speed while you do your quick menu stuff. then time speeds back up to 100% when you let off the button. but the [scripting reference][1] says i also need to drop down the fixedDeltaTime. but I'm not sure how to do it. this is what i have currently, it works well enough that i don't notice any messed up physics, but i have no idea what its doing. function actionMenu() { if (Input.GetButtonDown("ActionMenu")) { Time.timeScale = 0.1; Time.fixedDeltaTime *= .1; } if(Input.GetButtonUp("ActionMenu")) { Time.timeScale = 1.0; Time.fixedDeltaTime /= .1; } } in the script reference, the example they give is: // Adjust fixed delta time according to timescale // The fixed delta time will now be 0.02 frames per real-time second Time.fixedDeltaTime = 0.02 * Time.timeScale; i understand the " * Time.timeScale" part but what is the 0.02? [1]: http://docs.unity3d.com/Documentation/ScriptReference/Time-timeScale.html

Viewing all articles
Browse latest Browse all 112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>