I have this super simple graph that spawns a single particle and keeps it at (0,0,0) local space. The particle trigger gpu events to spawn a trail (particle strip).
The trail works as expected in Edit mode but in Play modeit has holes.
What i found out is that at the points where the discontinuities happen 2 particles are spawned at the excact same position which in turn seems to mess up the mesh calculation for the strip.
Applying a noise offset to every particle gets rid of the holes but that results in my trail being jagged.
Another way to get rid of the holes is to use Trigger Event Rate Over Time and using a number that is below my frame rate (e.g. 30) which will result in a super jagged trail when moving my Object fast.
Does anyone of you have clue how to handle this and/or why the issue does only appear in Play mode?
Did you try to enable clamp to one option of trigger event block? This is from memory, but I think it has option to clamp number of spawned particles to 1. Click the node and check the inspector.
This might not solve this problem, so other thing to check is simulation mode and use the one that ensure that delta is > 0 or simply check this inside your graph and set trigger event value to 0 when delta is too small.
Obviously I am assuming that you are correct and this is the cause of your problem.
Thx for your input! “Clamp to one” is enabled per default. I’m not quite sure what you mean with “simulation mode” but i tried using “exact delta time” and that did not work either and neither did the manual thing you suggested
I am short on time currently, so sorry I can’t help your more right now:
If you select VFX asset there is option to change how it updates, however this will not help you most likely as I noticed your graph is actually quite strange. You spawn single particle, but how this happens? over distance? manually spawning one? Just once or every frame? If it’s over distance then why you don’t use spawn over distance? If not then why you don’t spawn the strip directly from init?
Also are you aware you are spawning particles with infinite lifetime? I think when you don’t specify one they are there forever and in your case they spawn strips every frame. Actually your problem might different than you think - maybe you spawned too many of them, so they create gaps or they spawn from two different end points creating kind of zigzag back and fourth pattern and this cause them disappear.
The Orient of Strip need to be improved, and as you noticed if two particles of the same Strip are spawned on the same
position this can easily mess up the Orient, making the strip to render incorrectly and sometimes creating “holes”.
By looking quickly at your Setup, it seems that you’re trying to Spawn Particles based on the movement of the Parent System, as this Parent System only spawn one particle with infinite lifetime.
So I would suggest to Spawn Particles when some movement is happening. For this, you can try to use the "Trigger Event Rate (Over Distance) block.
As you can see from the Computed Source Code, it will trigger the event based on the Length of Velocity.
So we can try to compute a “Velocity” vector by Subtracting the “Current Position” with the “Previous Position”.
Here is a setup that as been working for me:
|
Setup in “Scene View”.
Same Setup in “Game View”
I’m joining this setup as a Unity package. Hope this will help you.
Sunshine on your day.
@Thorce , I’ve also noticed in your Screenshots that you’re allocating the memory for 500 Strip * 500 Particles per strip.
If you only need one strip, just set the Strip capacity to 1.