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 /
avatar image
0
Question by zachrkn · Mar 29, 2016 at 11:57 PM · camerabuildparticles

Manually positioned particles disappearing when origin is outside camera view in build only

I am manually setting the positions of particles in a particle system. In the editor, they work as expected. However, when I build to PC and run the built executable, the particles disappear when the origin of the world space (0,0,0) is outside the camera view.

I have read dozens of threads with related problems, but this seems distinct.

I've isolated the problem with a test project. Here is the very simple code of the script attached to the object with the particle system:

 using UnityEngine;
 using System.Collections;
 
 public class ParticleManager : MonoBehaviour {
 
     ParticleSystem myParticleSystem;
     private int numPoints = 5000;
     private ParticleSystem.Particle[] points;
 
     // Use this for initialization
     void Start () {
         myParticleSystem = GetComponent<ParticleSystem>();
 
         points = new ParticleSystem.Particle[numPoints];
 
         for (int i = 0; i < numPoints; i++) {
             float initialOffset = i * 0.1f;
             //points[i].position = new Vector3(initialOffset, 0f, 0f);
             points[i].position = new Vector3(Random.Range(-10.0f, 10.0f), Random.Range(-10.0f, 10.0f), Random.Range(-10f, 10f));
             points[i].color = new Color(1, 0f, 0f);
             points[i].size = 0.1f;
         }
     }
     
     // Update is called once per frame
     void Update () {
         myParticleSystem.SetParticles(points, points.Length);
     }
 }
 

In my scene, there are only two objects, the main camera and the object with the particle system.

The main camera has default settings. I haven't changed anything there.

The issue is reproducible with these settings for the Particle System (probably with any settings, but I can vouch for these settings for sure as they're in place as I type this): Duration: 5 Looping: false Prewarm: false Start Delay: 0 Start Lifetime: 0 Start Speed: 0 Start Size : 1 3D Start Rotation: false Start Rotation: 0 Randomize Rotation Direction: 0 Start Color: 1, 1, 1, 1 Gravity Modifier: 0 Simulation Space: World Scaling Mode: Local Play On Awake: false Max Particles: 1000

All the Particle System nodes are off except for Renderer. The Renderer settings are: Renderer Mode: Billboard Normal Direction: 1 Material: Default-Particle Sort Mode: By Distance Sorting Fudge: 0 Cast Shadows: off Receive Shadows: false Min Particle Size: 0 Max Particle Size: 0.5 Sorting Layer: Default Order in Layer: 0 Billboard Alignment: View Pivot: 0, 0, 0 Reflection Probes: off

Also, Resimulate and Wireframe are false

I've tried LOTS of things to make this work. I've tried setting simulation space to local, turning on resimulate and wireframe, making sure my object transform scale is 1, trying large and small transform scale, trying non-uniform transform scales. It even happens when I set the simulation space to local and parent the particle simulation to be in front of the camera. The particles follow the camera until the world origin is out of view, then they disappear. So, it doesn't seem to have anything at all to do with the particle system transform. This is not an exclusive list. I've tried everything I read in archives, but nothing worked.

And I repeat, this ONLY happens when the game is built, it does not happen at all in the editor.

Can anyone give any suggestions? I've run out of ideas at this point and I seem to have exhausted the archives.

This is in Unity 5.3.3f1. I've tried it on two separate computers (Windows 8 and 10) and in two separate projects.

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

2 Replies

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

Answer by karl_jones · Mar 30, 2016 at 09:21 AM

Sounds like a bug with culling and the AABB. Can you try the latest version of Unity 5.3.4~ If you still have the problem file a bug report and send me the number so i can take a look.

Comment
Add comment · Show 12 · 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 zachrkn · Mar 30, 2016 at 02:44 PM 0
Share

Follow up, this is FIXED in 5.4.0b12, the current newest Beta version at the time of writing this.

avatar image karl_jones ♦♦ zachrkn · Mar 30, 2016 at 02:52 PM 0
Share

Its possible that it is something that is currently being backported to 5.3. Ill look into it

avatar image karl_jones ♦♦ zachrkn · Mar 30, 2016 at 02:53 PM 0
Share

Have you tried the latest 5.3? http://unity3d.com/unity/qa/patch-releases

avatar image zachrkn karl_jones ♦♦ · Mar 30, 2016 at 02:58 PM 0
Share

I tried with 5.3.4f1 and it was not fixed as of that release.

avatar image Despox · Apr 12, 2016 at 12:23 PM 0
Share

i have the same problem

avatar image zachrkn Despox · Apr 12, 2016 at 12:34 PM 0
Share

Did you try the Beta release? As noted above, if I built my project from the newest Beta, this was not a problem.

avatar image Despox zachrkn · Apr 12, 2016 at 12:52 PM 0
Share

Unfortunately I am not interested in beta version as we have to release our game on S$$anonymous$$m this month and can't risk it

Show more comments
avatar image Despox · Apr 12, 2016 at 04:37 PM 0
Share

problem is only in build...code is classic infinity star for particle system: using UnityEngine; using System.Collections;

 public class Infinite_Starfield : $$anonymous$$onoBehaviour {
     private Transform tx;
     private ParticleSystem.Particle[] points;
     public int stars$$anonymous$$ax=100;
     public float starSize=1;
     public float starDistance=10;
     public float starClipDistance=1;
     public Color _Colors = new Color(0.8f,0.8f,1,0.8f);
     private float starDistanceSqr;
     private float starClipDistanceSqr;
         private ParticleSystem ps;
 
     void Start () {
         
         //tx = transform;
         tx = Camera.main.transform;
         starDistanceSqr= starDistance*starDistance;
         starClipDistanceSqr=starClipDistance*starClipDistance;
     
         ps = GetComponent<ParticleSystem>();
         points = new ParticleSystem.Particle[stars$$anonymous$$ax];
     
         for (int i = 0; i < stars$$anonymous$$ax; i++)
         {
             points[i].position = Random.insideUnitSphere * starDistance + tx.position;
             points[i].startColor = _Colors;
             points[i].startSize = starSize;
         }
      //   StarPosition();
     }
 
     // Update is called once per frame
     void Update () {
                 StarPosition();
         
     }
 
     void StarPosition()
     {
 
         for (int i = 0; i < stars$$anonymous$$ax; i++)
         {
             float magnituda = (points[i].position - tx.position).sqr$$anonymous$$agnitude;
 
             if (magnituda > starDistanceSqr)
             {
                 points[i].position = Random.insideUnitSphere.normalized * starDistance + tx.position;
                 points[i].startSize = starSize;
 
               }
 
             if (magnituda <= starClipDistanceSqr)
             {
                 float percent = magnituda / starClipDistanceSqr;
                 points[i].startSize = percent * starSize;
             }
 
         }
 
         ps.SetParticles(points, points.Length);
 
     }
 }
avatar image karl_jones ♦♦ Despox · Apr 12, 2016 at 05:28 PM 0
Share

Ok I know this bug. Its the bounding box not being updated when using SetParticles. It is on the way to 5.3 at the moment.

avatar image Despox karl_jones ♦♦ · Apr 12, 2016 at 05:38 PM 0
Share

thank you !

avatar image zachrkn Despox · Apr 12, 2016 at 05:29 PM 0
Share

This isn't an answer, so please be careful about how you're posting. You could start a new Question, or start a forum thread, or as $$anonymous$$arl asked you to, you could submit a bug report.

avatar image
2

Answer by richardkettlewell · Apr 13, 2016 at 09:35 AM

We are backporting a fix for http://issuetracker.unity3d.com/issues/shuriken-is-culling-particles-when-were-using-setparticles, which will be available in 5.3.4p4, which should hopefully fix this issue for you.

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

7 People are following this question.

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

Related Questions

Distribute terrain in zones 3 Answers

Game preview incorrect! 0 Answers

Camera Changes Proportions In Build 1 Answer

Overlapping particle systems 0 Answers

Linux build only displays colours 0 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