Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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
0
Question by Chris12345 · Apr 27, 2013 at 02:08 PM · particlespausetimescale

How to emit particle or un-pause particle when timescale =0?

How to emit particle or un-pause particle when timescale =0? My particle i have now runs great when timescale is = 1 but when it is = to 0 it is paused? how can i keep the particle playing even when timescale is = to 0?

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

4 Replies

· Add your reply
  • Sort: 
avatar image
-6
Best Answer

Answer by Negagames · Apr 27, 2013 at 07:21 PM

When you set the timescale to 0, everything on the scene is paused. No, you cannot run a particle system when the timescale is at zero.

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 liju_juego · Jun 18, 2018 at 11:51 AM 0
Share

The wrong answer. For the best way, find the answer to @$$anonymous$$ikina. The same technique is used in my RPG game.

avatar image
12

Answer by kk93 · Feb 19, 2014 at 11:36 PM

I know this is an old post, but the above answer is incorrect.

Just attach this script to the particle system you wish to ignore Time.timeScale:

https://gist.github.com/AlexTiTanium/5676482

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
5

Answer by Mikina · Dec 15, 2018 at 03:36 PM

For anyone who stumbles upon the question now:

There is a Delta Time property on Particle Systems, that can be set to Unscaled, which will cause the ParticleSystem to be independent of TimeScale.

alt text


48333237-2227758434168183-3017591060927873024-n.png (31.3 kB)
Comment
Add comment · Show 3 · 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 jennal · Apr 19, 2019 at 03:26 PM 1
Share

This is the correct answer.

avatar image liju_juego · Jun 04, 2019 at 10:15 AM 0
Share

This is the answer. After a long search, I integrated this technique in my RPG game. It's working fine. No need of adding any additional script.

avatar image dennispr33 · Mar 26 at 06:57 PM 0
Share

The Right way! Thank you very much for the help!

avatar image
4

Answer by seantheyahn · May 30, 2015 at 11:29 AM

Just attach this script to the GameObject with your particle system:

 using UnityEngine;
 using System.Collections;
 
 public class UnscaledTimeParticle : MonoBehaviour
 {
     // Update is called once per frame
     void Update()
     {
         if (Time.timeScale < 0.01f)
         {
             particleSystem.Simulate(Time.unscaledDeltaTime, true, false);
         }
     }
 }
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 Andriy-Zimbitskyy · Nov 11, 2015 at 03:37 PM 0
Share

Nice solution ! Thank You!

avatar image Xenocide · Jul 13, 2017 at 11:21 PM 0
Share

Firstly, this code has been very helpful, so thanks for that! However, my looping particle effects wouldn't 'un-pause' when Time.timeScale became 1 after being 0.

So I did this to fix my issue:

     void Update()
     {
         if (GetComponent<ParticleSystem>().main.loop == false)
         {
             if (Time.timeScale < 0.01f)
             {
                 GetComponent<ParticleSystem>().Simulate(Time.unscaledDeltaTime, true, false);
             }
         }
         else if (GetComponent<ParticleSystem>().main.loop == true)
         {
             if (Time.timeScale < 0.01f)
             {
                 GetComponent<ParticleSystem>().Simulate(Time.unscaledDeltaTime, true, false);
             }
             if (Time.timeScale > 0.01f)
             {
                 GetComponent<ParticleSystem>().Simulate(Time.unscaledDeltaTime, true, false);
             }
         }
     }

I hope that helps anyone who faced a similar issue to myself. If someone else finds a cleaner way to write this code, however, please don't hesitate to edit this... umm... edit. 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

20 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 avatar image avatar image

Related Questions

How do I pause my game? 24 Answers

Level completed but still playable (timescale problem) 0 Answers

Can't set Time.timeScale back to 1. 2 Answers

Best practice for countdown timer on game resume 1 Answer

Creating a pause menu (problem using Time.timeScale) 3 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