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
0
Question by Unamine · Mar 22, 2011 at 01:28 PM · timeeffectstop

How to create the effect of stoppage time?

I would like to know how to create an effect similar to the drying time, the style Time.timescale = 0, that everything was stopped, so I could only perform actions.

Thx in advance

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bampf · Mar 22, 2011 at 02:44 PM

Your question isn't entirely clear, but I'm assuming that you don't want to use timescale=0 because you want some things to stop and others to continue?

Here is one way to get the effect you want. Define your own floating point time variable, let's call it myCurrentTime. In Update, set myCurrentTime = myCurrentTime + Time.deltaTime, but only when the game is not paused.

Now the things that you don't want to be frozen (lerps and tweens, for example) should use Time.currentTime. The things that freeze would use myCurrentTime. You have absolute control whether myCurrentTime updates or not. You can also slow down time with it.

With this scheme is that you can freeze all physics and particle systems with timeScale=0, and keep most other things running on your time scale. Or you can do the opposite: keep physics running while myCurrentTime is frozen.

What you can't do with this idea is freeze some physics while the rest continue to run. If you need that, then you'll have to write code that freezes only the objects that needs freezing. This might involve marking them isKinematic to turn gravity off, and having code which moves them leave them alone when the game is paused. For a particle emitter you might need to deactivate it, then walk the list of particles, zeroing their velocities. You'd have to save those velocities and restore them later to unfreeze them. Etc.

Or, for some games it might be easier to not use built-in physics at all, and do all the movement with your own code. Then you could freeze and unfreeze individual objects at will.

So it can get quite complicated, depending on the game.

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 Unamine · Mar 23, 2011 at 12:45 AM 0
Share

Thanks for your GREAT answer, opened my $$anonymous$$d a bit how to do this feat, I am very grateful and I'll try later, anything post here

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

No one has followed this question yet.

Related Questions

How to add Hit Stop Frames? 0 Answers

How to make the enemy stops according the player position 1 Answer

How can i create a time bubble effect ? 0 Answers

How to end an animator animation using time? 0 Answers

How to pause Time(Time.timeSinceLevelLoad) 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