- Home /
How to get a ParticleSystem to play when you can't see it's origin point.
So for example let's say you set up a particle beam where the start point should be just barely out of range of the player's field of view no matter where the player is. You don't want them to be able to see the top of the particle beam which is shooting towards the ground. The effect should appear that the beam comes from space and therefor the player can't see above it.
However it seems that using Play() on such particles only works if the origin point is in view of the Main Camera...
So the result is if I move the ray starting height to 25 meters it always works but you can at times see over the top of it in the camera. If I move to 35 meters it works like 1/2 the time or less but you can't see over the top...
This is a really silly problem but one that I'm tired of trying to solve myself because it seems broken to me unless their is some settings or code to force it to play regardless whether it is visible by the camera.
If you have the Game playing in Unity Editor while also having the scene View open if the rays don't come down you can simply point the Unity Scene View towards the origin point and they begin to play in both scene view and game view...
There has got to be some solution for this but I can't seem to find anything even somewhat related in my searches for this problem so far.
Really tired of constantly getting held up on such simple things in Unity that make no sense to me.
Edit: Should also add I'm using this in a system where the beams turn on and off based on available items. When the items are Instantiated the beams are supposed to Play() in a position above them. Does not work unless the beams are set to heights that are unacceptably low.
I believe you are misinterpreting the result. I am using particle systems outside the camera's view, and it works. I must admit my system is only slightly out of view, so there may be something in your theory, but it sounds unlikely to me for Unity to have such a weird and limiting feature...
When the scene first loads both the particle beams play (one for health potion, one for energy potion).
The problem seems to come after you Stop() the particleSystem when the the user picks up a potion.
When the next stage of level starts and new potions instantiate the particle beams do not Play() 100% of the time unless their height is very low and within the camera view.
It seems like a bug to me as the particles should play no matter what but for some reason the Unity Engine fails to do this. I can't find anything online so far that shows that this is the expected behavior.
So basically once you use Stop() after the scene begins the particleSystems seem to be bugged when you use Play()
It really seems like a Unity bug that somehow these beams just don't work since it's such simple code.
But there's always the possibility I need to use certain settings on the Particle System or project settings to avoid this behavior... kind of doubt it in this specific case.
I guess I could instantiate new prefab particle systems every time ins$$anonymous$$d of Stop() and Play()ing them, but the game is aimed for mobile so I'm always trying to improve performance and that seems like a crappy solution.