Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 MutualTeats · Oct 08, 2013 at 09:21 AM · objectslowing-downsphere raycast

Is there a local Time.timeScale?

I just found Time.timeScale and I noticed that it affects the whole game. Though, is there a local Time.timeScale (or likewise) for a specific object? Like if I have a time-device that slows the time for all objects within a certian sphere, but not those outside?

Thanks in advance :)

BTW my question is not "How to pause the game", I am just curious if timeScale is the easiest way to slow down time (NOT entierly stop it, slow it down!) for specific objects

Comment
Add comment · Show 14
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 Fattie · Oct 08, 2013 at 09:32 AM 0
Share

1) There definitely is not

2) As a rule, there is very very little reason to use timeScale. You could go so far as to say "never ever use it." You should explain what you are trying to achieve.

3) For timers in Unity you use Invoke() or InvokeRepeating(). Pls search on here for millions of great examples about it.

avatar image Hoeloe · Oct 08, 2013 at 10:21 AM 1
Share

@Fattie: timeScale is useful in some circumstances, for example, pausing the game (though you do need to be careful with it).

I'd recommend having a time$$anonymous$$ultiplier variable in each object you want to control individually, then, for any movement you do, multiply it by this value. This will allow you to slow down motion by setting it to a value less than 1, or speed it up by setting it to a value greater than 1.

avatar image Fattie · Oct 08, 2013 at 11:01 AM 0
Share

lol dude I've been explaining timeScale to people on here for some three years ;-)

avatar image Fattie · Oct 08, 2013 at 12:50 PM 1
Share

BTW mutual there are various assets on the asset store you should check out, relating to pausing gameplay. I have not tried any but for example http://forum.unity3d.com/threads/136139-Pause-Controller-Released-Group-Pausing-without-timeScale-0

pausing gameplay is always a huge problem. be aware that "setting the time scale to zero" (in "all of unity") is kind of a quick fix. We're all guilty of it at times but it's not like at nintendo they go oh set the timescale to zero to pause.

Really every single thing in the game (I mean enemies, clouds, whatever) should have a "game pause" concept and you signal them all to pause. generally the whole business of pausing games is a huge nuisance. inevitably in any game you have zillions of timers and what have you in progress and they all have slightly different paradigms of how they should be treated for a "game pause". of course you can't pause - notably - the button that allows you to unpause :) the whole thing is a pain in the ass

avatar image Hoeloe · Oct 08, 2013 at 01:02 PM 1
Share

What most games do during pause is prevent game-changing motion (characters moving, attack animations, etc.), but ignore the rest of the scene. They then take a screenshot of the scene, and draw that over the screen ins$$anonymous$$d of rendering anything - this gives the illusion of proper pausing, while not having to bother with fine details.

Having said that, actually stopping the update loop (which is essentially what setting timeScale to 0 does) is a perfectly valid way of pausing a game, and a lot of games do use it. They do, however, often run a second update loop (or have a conditional that runs either one loop or the other depending on pause state), unrelated to the main game's loop, to handle the pause menu.

Show more comments

1 Reply

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

Answer by meat5000 · Oct 08, 2013 at 09:27 AM

You can easily make your own Timer by making a variable a function of time. Use that in a script instead of Time.time and you can scale it how you please :)

e.g If you have

timer += Time.deltaTime and only call it every other frame you are getting a half timescale. Or just add a multiplier.

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 MutualTeats · Oct 08, 2013 at 10:19 AM 0
Share

Alright, thanks :)

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

18 People are following this question.

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

Related Questions

Bullet slowing down while snapping to sphere normals 0 Answers

getting the direction of object 1 Answer

Emmiter in time intervals 1 Answer

swapping out an object on collision 2 Answers

Problem with Object collision 1 Answer


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