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 Vincent P · Jan 16, 2013 at 06:19 PM · c#particles

How do I properly use particle simulation in Unity?

So I'm using Unity's simulate function to pre-render particles. So that I can already have clouds moving over head, without the player having to wait.

It seems that simulate is not quite working as to what I expect. It's most likely a setting that I missed. But I just really cannot find the issue.

This is from inside the editor, I clicked on the particle object and just let it run This is from inside the editor, I clicked on the particle object and just let it run. This is what I'd like.

This is after I've run the game a little bit, then hit pause This is after I've run the game a little bit, then hit pause. This is what is currently happening, for some reason the particles get bigger.

Here is the script that I've attached.

 public float initTime;
 public ParticleEmitter partEmitter;
 // Use this for initialization
 void Start () {
     for (float i = 0.1f; i < initTime; i = i + 0.1f) {
         partEmitter.Simulate(i);
     }
 }

Particle Renderer Settings As asked, here is also a what my Particle Renderer settings looks like.

alt text Here are more of the settings, but fully expanded

I've run this scene in both Unity 3.5 and in Unity 4.0. Same thing happens in both versions.I'm pretty sure that it's something to do with the script. But I've tried many different pieces of code and they are all similar and do the same thing.

particle renderer.jpg (16.3 kB)
clipboard01.jpg (49.4 kB)
Comment
Add comment · Show 9
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 Hyperion · Jan 17, 2013 at 07:11 AM 0
Share

Just checking, what settings do you have on your particle renderer?

avatar image Vincent P · Jan 18, 2013 at 05:39 AM 0
Share

@Hyperion: I've added the screen shot. Do you have any thoughts on this?

avatar image Hyperion · Jan 18, 2013 at 06:25 AM 0
Share

Alright, your renderer settings are fine. Next, we must check the particle animator, and in fact, the emitter. Unfortunately I forget which of these has the settings for velocity and stuff like that. By the way, thanks for the picture.

Also, to make the growing less visible, it is possible to decrease the max lifetime (energy) of your particles. But that probably won't solve the problem. Could you please show me the other settings too?

avatar image Hyperion · Jan 18, 2013 at 06:33 AM 0
Share

Oh, and you said clouds. Since clouds are similar to fog, there is a camera script that allows you to prerender fog. I'm showing this just in case the script is the issue.

using UnityEngine; using System.Collections;

public class example : $$anonymous$$onoBehaviour {

private bool revertFogState = false;

void OnPreRender() { revertFogState = Render Settings.fog; RenderSettings.fog = enabled;

}

void OnPostRender() { RenderSettings.fog = revertFogState; }

}

avatar image Hyperion · Jan 18, 2013 at 06:36 AM 0
Share

Sorry for over commenting, but since you are using particleemitter.Simulate, there also might be a setting in the partEmitter regarding size over time.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Hyperion · Jan 24, 2013 at 09:18 PM

Okay, here's that answer posted. And I also had one other thing to say: Make sure your World Velocity is set to 0 in X,Y, and Z. That'll mean the clouds can't get stretchy.

Javascript/Unityscript:

var emitter: ParticleEmitter;

function Update () {

// Simulate 10 seconds

for (i = 0; i < 10; i++) {

   emitter.Simulate(1.0);

}

}

I think C# would be:

ParticleEmitter emitter;

void Update () {

// Simulate 10 seconds

for (i = 0; i < 10; i++) {

   emitter.Simulate(1.0);

}

}

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

9 People are following this question.

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

Related Questions

Can you change the Velocity Over Lifetime of a Particle System using a Script? 3 Answers

C# Emit Particle Upon Left Mouse Click 2 Answers

Distribute terrain in zones 3 Answers

Multiple Cars not working 1 Answer

A node in a childnode? 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