Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by thokasen · Apr 27, 2016 at 04:36 PM · sceneparticlesystemscene-loadingstatesimulate

Managing particle systems depending on scene whilst remembering state

Hi, guys! Hoping I could get some help on an issue I've been struggling on for some time.

I have two rooms. A kitchen and a hallway; two separate scenes. I also have particle systems in each room in the form of fires and smoke. And to manage these fires, I have a FireManager. Now, the GameManager cues the FireManager for when the fire should start. The FireManager has already instantiated the fires in Awake(), and then it just .SetActive(true) on the two fires, when the GameManager calls for them to start.

Let's say I stand in the kitchen when the fire starts. I see the fire develop a bit, and then enter the hallway where the fire hasn't started yet. And then I enter the kitchen again. Now, the flames should have grown a little in the time I've been in the kitchen. And there should also be more smoke in the kitchen.

And this is where the problem/trade-off lies.

1) If I disable fires depending on which room I am in, i.e. disabling kitchen fire when entering hallway, and then re-enable kitchen fire when re-entering, the kitchen fire starts at the beginning again.

2) If I keep both fires enabled throughout, the particle system from one room will enter the other room, i.e. the flames from the kitchen comes through the wall and into the hallway.

So, basically my question is how would I go about managing these fires so that either

1) the states of the fires are managed whilst using .SetActive (or any other method for that matter)

2) Keep the flames contained within their respective room/scene.

Note : It is probably worth mentioning that these fires contain several fire particle systems within themselves. At root there is an empty gameobject, which contains gameobject containers for different types of fires. i.e. an empy gameobject within the fire hierarchy called "Small Fires" which have script components for scaling and moving the fire, and underneath that object, the actual fires reside. If that makes any sense. Not sure if that is relevant for the question though.

Note 2 : I've looked at the Simulate - function, but I haven't been able to implement it successfully. Because how would the FireManager be able to tell the fires to simulate? I can't make the FireManager call internal functions on the fires, so I don't know FireManager would be able to tell the fire "Hey, someone entered the room. Start simulating the fire as 10 seconds has elapsed".

Note 3 : This is to run on android and iOS mobile phones with the use of VR, so performance is a key issue here.

I'm reeeally hoping for more than a once-sentenced answer, but I'll take anything I get at this time :)

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 Glurth · Apr 27, 2016 at 05:43 PM

I would suggest that you use your METHOD 1 above, where you disable the fire depending on the room you are in. However, rather than enable/disable the particle systems using SetActive(), I would suggest you use the ParticleSystem PAUSE function, which should allow it to continue from where it left off. Alas, I do NOT know if anyway to disable the DISPLAY of a paused particle system (simply disabling it causes it to restart, even if paused. I guess you could always do somkind of workaround, like move it far away, out of view.)

An alternative would be to use the GetParticles and SetParticles functions of the ParticleSystem class, to save, and then reinitialize the state of the particles.

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

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

60 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 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 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

Game state management & and passing data between scenes -1 Answers

garbage collection in between scene changes? 2 Answers

Restarted scene not working properly 0 Answers

After reloading the scene twice one script doesn't work. 0 Answers

Loading and Unloading scenes 2 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