Search Unity

Particle Playground

Discussion in 'Assets and Asset Store' started by save, Dec 4, 2013.

  1. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Looks wonderful! :)
     
  2. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    Looks impressive. Can the splines be moved or extended at runtime or can they only be used as fixed paths that are made in the editor ?
     
  3. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Looks wonderful and Looks impressive :p

    "Can the splines be moved or extended at runtime...?"
    +1

    BTW Save, thanks for the link..... :cool:
     
  4. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Great! :)
    Yes you can move, add and remove splines and their nodes at runtime. The nodes and bezier handles can be controlled as Vector3 values through script or you can hook them up to transforms to "just make things happen".
     
  5. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Before the insanely big 2.2 update I'd like to wish you Happy Holidays!

     
  6. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    have you a date ? ;)
     
  7. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    It's currently a loose January date, all features and fixes isn't fully ready yet and it's just so much to go through in testing. It's the biggest update yet and I'm really eager to get it out though... :)
     
  8. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    :) cool, I can not wait !
     
  9. Dave_Voyles

    Dave_Voyles

    Joined:
    Feb 7, 2014
    Posts:
    32
    How can I make my particle start from the beginning of its loop when it is iniatlized, or re-activated?

    In my current situation, I'm using your Viral Spiral and I want to appear just before an enemy spawns on screen, to notify the player that an enemy will appear thre in a moment. I have that down so far.

    The issue I run into however, starts when I deselect loop from the particle settings tab on the playground, it will stop rendering once the particle has looped. That's fine.

    If I do this, then try to create a new instance of the particle, it remains not visible.

    I'm creating it like so:

    Code (csharp):
    1.  
    2.         Instantiate(_playgroundSpiral, spawnLocation, Quaternion.identity);
    3.  
    Finally, what is the best way for me to garuntee that I'm reusing the same instance over and over? I'd rather not create a new particle each time.

    Thanks!
     
  10. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    Hi,

    I'm still using ParticlePlayground for various swarming emitters in our game, and I'm having difficulties instantiating single-shot particlePlayground emitters, and getting them to actually emit the correct thing. Basially, I have a single prefab, on which I want to set a few parameters (particle size, ramps, etc), then call a one-shot emit.

    The code below is only the size altering part of the particle behaviour, but I can confirm that if I do what follows, with a one-shot emitter, about 20% of the time particles are emitted at the size they're specified in the prefab, and about another 20% they aren't emitted at all.

    I've tried various permutations of disabling emit, disabling the game object, emitting in various ways through code, with basically the same results.

    Is there any way to say "hey particle system, do a one shot emit of your full particle count right now. Oh, and make sure anything you've cached internally represents the values I've set on your component a moment ago?"

    Thanks,
    Alex



    Pseudo-code for doing this using a prefab with an enabled Emitter set to single shot.

    Objectparticleobj = Instantiate(particlesPrefab);

    particles = particleobjasPlaygroundParticlesC;
    particles.name = particles.name + "_" + this.name + "_" + this.brush.brushTextures[0].name;

    floatactualParticleSize = requestedParticleSize * 2.0f;
    particles.sizeMin = actualParticleSize;
    particles.sizeMax = actualParticleSize;
     
  11. gonzorob

    gonzorob

    Joined:
    Dec 1, 2011
    Posts:
    96
    Hi,

    Quick question: How do I stop the particles scaling with the window size/aspect ratio ?

    Example:

     
  12. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey Dave,
    To make an effect start over you can call:
    Code (CSharp):
    1. particleSystem.Emit (true);
    That will set the particle system's time to current.

    Calling Instantiate on a GameObject in the scene will create a clone each time, so it's better to have a pool of the reused effects. You can have a look at the script SwitchCachedParticleSystemC.cs in the Examples/Example Scripts/Simple Scripts folder, and adapt it to your needs (possibly make EnableParticleSystem public and remove the Update function).

    Hi Alex,
    It's a bit difficult to get the full picture of the scenario but make sure you use the particle system you've altered and that you alter the instantiated object. Try something similar to this approach:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class InstantiateAndSetSize : MonoBehaviour {
    6.  
    7.     public PlaygroundParticlesC particlePrefab;
    8.     public float sizeMin = 1f;
    9.     public float sizeMax = 1f;
    10.  
    11.     void Update () {
    12.         if (Input.GetMouseButtonDown (0))
    13.             InstantiateParticles();
    14.     }
    15.  
    16.     void InstantiateParticles () {
    17.         PlaygroundParticlesC particles = (PlaygroundParticlesC)Instantiate(particlePrefab);
    18.         particles.sizeMin = sizeMin;
    19.         particles.sizeMax = sizeMax;
    20.     }
    21. }
    22.  
    You might also gain from reusing particle systems and have them pooled (see post above).
    Does that help you in the right direction?

    Hi there,
    You can enable the Shuriken component (Playground Manager > Advanced > Show Shuriken), then set Renderer > Max Particle Size to something around 10. I'll change the PP > Rendering > Max Particle Size to a float field instead of a slider so you won't be limited in next version.
    Keep in mind that having transparent quads on top of each other (large on screen) will quickly run into problems with fillrate, especially on mobile.
     
  13. Dave_Voyles

    Dave_Voyles

    Joined:
    Feb 7, 2014
    Posts:
    32
    Awesome thanks! I'll work on that today and let you know how it turns out!
     
  14. x3Frozen

    x3Frozen

    Joined:
    Oct 22, 2013
    Posts:
    3
    Hi ,can you help me to find a solution to this problem? I want that particle have draw infront of mesh.
    I have tried to used sortingLayer but it works only to 2D. Thx
    b7d53-clip-91kb.jpg
     
  15. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    Yeah, it looks like changing parameters on a newly instantiated particle system is a bit flaky.

    Some of the problems stem from the fact that SetParticleCount() runs asynchronously, and is called from OnEnable(), so if you're trying to instantiate a particle system from a prefab then immediately set its particle count then that's actually a no-op.

    A similar situation may exist when modifying sizeMin/Max (because they don't get propagated down the chain to the particle cache? Haven't debugged fully yet.)
     
  16. Jotunn

    Jotunn

    Joined:
    Jan 10, 2014
    Posts:
    22
    Hello,
    Can I stretch particles along one axis by lifetime?

    In other words, if particle is GameObject, I want to do like this:

    Code (CSharp):
    1.   void Update()
    2.   {
    3.     Vector3 scale = transform.localScale;
    4.     scale.x += 0.01f;
    5.     transform.localScale = scale;
    6.   }
    In Playground Particles inspector, "Particle Settings" section have "size" and "Lifetime Size" parameter, but it is float.
    So I can't find a way to stretch along only one axis.

    Thanks!
     
  17. Jotunn

    Jotunn

    Joined:
    Jan 10, 2014
    Posts:
    22
    Hello, sorry frequent and newbie questions.
    How to emit particles radially like on Shuriken, set "Shape" to "Sphere" or "HemiSphere" ?

    Thanks!
     
  18. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi,
    You can specify the rendering order in the shader or by the material's render queue. That way you could always draw your particles on top of the terrain.

    Yes you're right, upon load it must initialize the arrays if PlaygroundCache is null (otherwise refresh the time related cache). Would it be preferable to have an option to not run that asynchronously? Essentially it's just for speeding up loading times.

    Hi,
    Sorry no that's not possible out of the box, stretching happens by velocity only (standard Shuriken behavior). I'll be testing some possibilities modifying the stretch in alternative ways after next release, hopefully we can approach something similar to what you're after.

    Hi,
    That's actually more of a common sense question. :) Playground doesn't support shapes yet, I'm working on it though. Next version will have spherical scatter and velocity. You could also solve a spherical emission using a repellant manipulator in the middle of the field of particles.
     
  19. Jotunn

    Jotunn

    Joined:
    Jan 10, 2014
    Posts:
    22
    Thanks save!
    About stretching, makes sense. I look forward to next release.:)
    And I tried repellant manipulator. It is interesting!

    Sorry, and more a question...
    I enabled "Rotate Towards Direction" and set initial velocity. It works fine.
    But, to pause game, set Time.timescale = 0.0f, all particles rotation looks 90 degree.
    and to resume game, set timescale = 1.0f, all particles rotated toward again.
    Are there any way to keep particle direction while pausing?
     
  20. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey Jotunn,
    I've taken a note on the rotate towards issue, I'll be testing out what we can do about it asap and hopefully have a solution along with the upcoming update.
     
  21. gonzorob

    gonzorob

    Joined:
    Dec 1, 2011
    Posts:
    96
    I'm attempting to change the alpha value of particles within an manipulator. (particles closer to the center fade out)

    After modifying the particle at "particles.particleCache[p.particleId].color" I can't see any difference.

    ('p' is from ManipulatorObjectC.particles and 'particles' is a PlaygroundParticlesC)

    Is there an 'Apply' function I'm missing?
     
  22. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Alright found the issue, this will be fixed soon. ;)

    The reason why setting colors directly doesn't work is that their value is given from the specified Color Source.
    If applicable in your case it's easier to use another manipulator for changing colors, try using this setup:
    Code (csharp):
    1. Type: Property
    2. Property Type: Color
    3. Particle Color: Black (0 alpha)
    4. Transition: Lerp
    The Color Strength and Manipulator Strength will determine the interpolation speed.

    Although if you want to alter colors by your own rules you can mimic as if a particle has been affected by a manipulator by setting:
    Code (CSharp):
    1. particles.playgroundCache.changedByPropertyColor[p.particleId] = true;
    2. // Then apply your new color
    3. particles.particleCache[p.particleId].color = yourColor;
     
  23. gonzorob

    gonzorob

    Joined:
    Dec 1, 2011
    Posts:
    96
    The Property setup is exactly what I was trying to recreate - thanks for the help!
     
  24. Jotunn

    Jotunn

    Joined:
    Jan 10, 2014
    Posts:
    22
    Great! Thanks save!
    I look forward to fixed version.
    Thanks!
     
  25. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Great! I'll soon be able to cover the manipulators etc. in a couple of more videos, hope it will clear up some good praxis approach. :)

    Splendid! I'm just about to wrap up for the beta round.


    To prepare any interested on the forthcoming, here's some frequently requested features implemented during 2.2 dev cycle:

    1) Several Transforms as Source, can do some neat visual things together with Overflow Offset for instance:

    Thanks to @grimmgames for requesting the type of visual effect, no longer need to go through a hacked State for this type of otherwise straightforward setup. ;)

    2) There's been a handful support errands asking for prewarming features, so here's a little teaser of what will be possible in next version (time scrub and resolution):

    No more need to take the Snapshot approach... :)

    3) Another thing is you'll be able to compress the lifetime emission pattern (regarding @Anguis specific request):


    4) Mask sorting, to change the appearance pattern when applying a mask:


    5) State target Manipulator, targets a texture or "static" mesh within the scene:

    Chroma Key to States is also introduced with ability to filter out a specified color (good for non-alpha textures). This was implemented for a specific project where the client needed to grab screenshots from the web and turn them into particles, thought there might be more out there in need of that.

    6) Spherical minimum to maximum range method (applicable to scatter and initial velocity):

    There's also a Spherical Linear method, which lets you distribute the effect along the particle array, this can be useful if you'd like to have a linear sequence as such:

    Effect is using Source Scatter with Method: Spherical Linear, Lifetime Sorting: Linear and Color Method: Particle Array to linearly distribute all scatter over the lifetime cycle. I'd imagine this technique would come in handy when making detailed explosion patterns.

    7) And finally Time Scale (!) with ability to seamlessly change simulation speed and pause:


    Also don't miss the holidays discount if Playground is something for you. :)
     
    hopeful likes this.
  26. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649

    Oh yeah!!!
     
  27. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Love the enthusiasm ZJP. :)

    A fix for an almost ancient issue got into the code today, sorry about the rather long delay on this one @erichart3d. The problem stemmed from the delta between birth time and the current simulation time, where the "resolution" of particle distribution would offset depending on framerate. From version 2.2 you can expect this more exact behavior:
     
  28. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    Hello, I have bought this awesome and amazing asset and think is really great and powerful with great potential to make wonderful things and love all the demos and works done with this

    I want to ask how to make two things I have seen in videos and would like to reproduce if possible with Particle Playground 2

    I wonder if these kind of lovely stars shown on the 2 videos below could be done with particle playground and make a similar effect of a sky of with these stars and then after have some of them falling in 3D style over the ground and objects and HOW would be possible to make a similar animation in Unity

    NUMBER 1 - Incredible and spectacular Multiplying Animated Shiny and Flickering Stars in 3D space

    At the end of the movie "Sunshine" there is a particular explosion that is really beautiful and spectacular and would really love to know if something like this could be done with Particle Playground 2



    1 - 0:00 - Appears the first star and quickly begins to duplicate themselves exponentially filling all the place without overlapping
    2 - 0:17 Now that thy have filled all the above top space begin to duplicate themselves downward
    3 - 0:30 Closer and near look of those amazing stars and then are converted to fire stars
    4 - 1:16 the right place is filled with fire stars

    I would only like to know about the normal white stars duplicating themselves and not about the fire stars

    NUMBER 2 - Animated Shiny and Flickering Stars sky with some of them falling in 3D after

    https://www.youtube.com/watch?v=XRAUKrImMrs Paul Oakenfold - "Starry Eyed Surprise" Ft. Shifty

    I have seen this music video and on the following parts there are stars
    5 - 0:10 Stars in the sky very short and not very good
    6 - 2:06 and 2:20 much better view and more beautiful shiny and sparkling stars with different sizes
    7 - 2:27 closer and great view of these stars start falling in 3D style over the people and can be seen even better
    8 - 2:33 in the following seconds there is a whole stars "rain" that looks very beautiful, specially on 2:47

    I would thanks very much if it could be known how would be possible to do this, and how to make it.

    Thanks very much for any help

    Happy New Year 2015 and I wish all the best
     
    Last edited: Jan 2, 2015
  29. Jotunn

    Jotunn

    Joined:
    Jan 10, 2014
    Posts:
    22
    Happy New Year.
    Ver2.2 looks fantastic... In particular, Spherical method, lifetime emission, time scale.
    I look forward it.

    And I have a question.
    When emit particle by PlaygroundParticlesC.Emit(), can I set random integer to "order In Layer" each particle?
    With many particles, I want to randomize their order in layer.

    Thanks!
     
  30. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey SpaceRay, Happy New Year!

    Sorry for the delayed answer, in crunch for beta release. There are a couple of ways achieving both these effects.

    For #1 (good movie!) you could try a moving emitter with any Source you see fit. A Transform with Source Scatter could be enough (or a plane as World Object), with Lifetime Sorting of Scrambled/Linear. Over the emission time you can move the source down on the Y-axis.
    If you'd like you could also set up an Event set to Broadcast Type: Target which will make an additional particle system emit on top of each created particle at the Type specified.
    In pre 2.2 you need to set Lifetime Offset to +lifetime to not start in the middle of the lifetime cycle.

    #2 you could start off with #1, then you could either let Lifetime Velocity on the Y-curve go below 0 or change Gravity at specific time by script. For a more controlled behavior you could try letting Force > Force Annihilation > Lifetime Positioning take over the movement for the particles.

    Feel free to ask for any specifics of course, but the gist of it is that you can! :)

    Hey Jotunn, Happy New Year!
    There's no way I'm aware of sending individual particles to different layers without having a particle system for each layer order, but you could try making use of the Sort Mode (and possibly Sorting Fudge) found in the Shuriken component's Renderer. Enable the Shuriken visibility by Playground Manager > Show Shuriken, in 2.2 Sort Mode and Fudge are lifted into the Rendering tab of the PP system.
    From the manual:
    Otherwise try using another shader which will let the particles render to the depth buffer (for instance Transparent/Cutout/Soft Edge Unlit).
     
    Last edited: Jan 7, 2015
  31. Jotunn

    Jotunn

    Joined:
    Jan 10, 2014
    Posts:
    22
    Thanks save.
    I wanted to emit particles and display or hide each particle by ZTest.
    So, "Transparent/Cutout/Soft Edge Unlit" works fine!
    I will try to create a shader Additive with ZTest.

    And... sorry, one more question.
    With short lifetime, Texture Sheet Animation is incomplete.

    For example, create a material for particle and set texture with 4 x 2 animation. (like attached file)

    And enable the Shuriken visibility, enable "Texture Sheet Animation", set below parameters.
    Tiles: X = 4, Y = 2
    Animation: Whole Sheet
    Frame over Time: Curve (Linear (0, 0) - (1, 8))
    Cycles: 1

    And set lifetime 0.3, particle animation skip some frames.
    (With attached image, "1", "7", "8" not displayed)

    When set lifetime 1, animation played complete.
    And Shuriken Particle System with same parameters(lifetime 0.3), animation played complete.

    Is there a way play texture sheet animation complete with short lifetime?

    Thanks!
     

    Attached Files:

    Last edited: Jan 9, 2015
  32. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Alright great!
    Sorry about that one, this is fixed in 2.2. There's a bug in the lifetime and startLifetime sent to the Shuriken for each particle making the UV steps inconsistent. I'll send you a PM!
     
  33. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
  34. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    This is the right place @Exeneva, to me at least (not sure what moderators say). :) My time is limited but I'll try to help spread the word.
     
  35. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Currently working on a release video for the 2.2 update. All effects will be available in a free package when done, anything special you would like to see in that?

    Here's a couple I think might make it in:


     
    ZJP and hopeful like this.
  36. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369

    Cool !

    Save, have you able to correct bug of becomeVisible and the wierd allocation of 3.0 KB per frame ?
     
  37. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Honestly, I'd like to see something that is out-of-box awesome and useable for a lot of games. In particular, something like a wave burst effect. Think of games where a character levels up and a particle effect happens, or when a character gets buffed during a battle.





    Now, I know what save is thinking - this is already possible with Particle Playground 2! However, I think out-of-box useability would really push the asset over the top. While I think it's cool to play around with the asset now, there's no initial incentive when you get the asset. If there were out-of-box effects that I could use, I would tweak them for my game and learn a bit of the workflow in the process. I would then be much more interested in learning the other, more cool things in particle playground.

    Basically I'm saying there should be more than the default effects included, and there should really be more effects that are ready to go with minor tweaking, especially in the area of RPGs. Just my opinion.
     
  38. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    Oh, that's a great idea!
     
  39. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Any info about version 2.2 release date? Really excited to play with the splines in a project of mine :)

    Also, will the update still work with Unity 4.3.4? *crosses fingers*
     
    Last edited: Jan 15, 2015
  40. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hopefully we're able to sort it out through the beta. :)

    I really like this idea! The only issue is that these type of effects take quite some time in production on the graphical side, where I've been busy extending and optimizing the platform. All examples currently provided serve as a technical showcase where the 2.2 fx package will still be drawn towards that type as that will be the purpose of the video.

    After the release I'll look things over, I'm aiming for another large update sometime during 2015 where this approach would fit in quite perfect. More learning material will also be available right after the update, where I hope artists will feel more comfortable jumping into the framework.

    All in all good suggestion, I'll work towards it!

    It looks good for a late January release. Still available on 4.3.4! :)
     
    hopeful and DMeville like this.
  41. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Oh yeah (again). Amazing. Just do the...Job. :cool:


    Imagine a dust wave effect following the terrain. :eek:
     
  42. frontakk

    frontakk

    Joined:
    Jan 8, 2011
    Posts:
    292
    Hi.
    I have a question.
    Particle emit to random on a surface is possible?

    And I wanto to use time event emit particle scatter position, possible?

    Sorry bad English...
     
  43. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    That's a cool idea. :)

    Hi!

    Random on surface
    The only builtin ways to emit on top of a surface is by using Projection or Paint. These require a collider (either 3d or 2d) as both methods uses raycasting to find positions. Projection will take a texture where each non-transparent pixel represents a raycast position, where upon hit with any collider in the scene will create a particle birth position. Paint is similar, but freehand in Editor or by script.
    If you for instance are using a World Object, you can use Source Scatter to efface the vertex pattern but with limited control over the end result within the scatter area specified.
    Do any of these methods work in your case?

    Random position on timed event
    To get random emission positions from a timed event, you can use an Event Listener in a script. Whenever your listener is triggered by the event you can emit a particle at the event particle's position. Here's an example:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. [ExecuteInEditMode()]
    6. public class EmitWithRandomPositionOnEvent : MonoBehaviour {
    7.  
    8.     public PlaygroundParticlesC eventParticles;                    // The particle system you wish to listen on
    9.     public PlaygroundParticlesC emissionParticles;                // The particle system you wish to emit from upon the event
    10.     public int eventNumber = 0;                                    // The event number in the list of the eventParticles events.
    11.     public Vector3 randomRangeMin = new Vector3(-1f,-1f,-1f);    // The minimum random range you wish to add to the emitted particle.
    12.     public Vector3 randomRangeMax = new Vector3(1f,1f,1f);        // The maximum random range you wish to add to the emitted particle.
    13.  
    14.     System.Random random = new System.Random();                    // Use System.Random instead of Random.Range due to the multithreaded environment.
    15.  
    16.     void Start () {
    17.  
    18.         // Early out if this isn't setup yet (as we have ExecuteInEditMode enabled)
    19.         if (eventParticles==null||emissionParticles==null)
    20.             return;
    21.  
    22.         // Assign your listener to the delegate
    23.         if (eventParticles.events.Count!=0 && eventNumber<eventParticles.events.Count)
    24.             eventParticles.events[eventNumber].particleEvent += EmitWithRandomPosition;
    25.     }
    26.  
    27.     /// <summary>
    28.     /// This function will run whenever the event broadcasts from the assigned eventParticles.
    29.     /// Note that this is running on another thread if nothing else is specified for the Thread Aggregator,
    30.     /// you can therefore only use thread-safe methods within the scope of the listener.
    31.     /// </summary>
    32.     /// <param name="eventParticle">Particle that broadcasted the event.</param>
    33.     void EmitWithRandomPosition (PlaygroundEventParticle eventParticle) {
    34.         emissionParticles.ThreadSafeEmit (
    35.             eventParticle.position+RandomRange(),
    36.             eventParticle.velocity,
    37.             eventParticle.color
    38.         );
    39.     }
    40.  
    41.     /// <summary>
    42.     /// Borrow the multithreaded random range in Playground.
    43.     /// </summary>
    44.     /// <returns>The random range.</returns>
    45.     Vector3 RandomRange () {
    46.         return PlaygroundParticlesC.RandomRange (random, randomRangeMin, randomRangeMax);
    47.     }
    48. }
    49.  
    Where the Event is setup like this:


    Will produce something like this:


    Hope it helps, ask if you need more details of course!
     
  44. frontakk

    frontakk

    Joined:
    Jan 8, 2011
    Posts:
    292
    Hi save.
    Very thanks.:)
    OK I'm try it !
     
  45. frontakk

    frontakk

    Joined:
    Jan 8, 2011
    Posts:
    292
    Particle Play Ground is very nice asset!!
    I'd release at assetstore.;)
     
  46. I_Dont_Know

    I_Dont_Know

    Joined:
    Oct 14, 2014
    Posts:
    3
    Hi, I have a problem with using a skinned mesh as a source. I want to use "only source positions" though it seems as if the particles positions update a frame to late, basically making it look double when the skinned mesh moves. In the image I took your "InvisibleRobot" example scene and made the source transform move to the right. Is there a solution or workaround for this?
     

    Attached Files:

  47. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Looks great! I hope you do. ;)

    Hi!
    The only way to ensure that every particle is birthed at the correct vertex position of a skinned mesh is to do the extraction on the same thread as the one that is putting particles into Shuriken.
    The workaround comes in 2.2 just around the corner, you'll have a toggle called "Force Update On Main-Thread" for skinned meshes in the Source tab. The rest of particle calculation will still run multithreaded and it will bypass the Skinned Mesh Thread Method having that enabled. If only Unity would make putting particles into Shuriken and updating/extracting vertices on another thread available, that would open up for other more interesting approaches.

    You can also unfortunately experience a one frame lag on any source in versions under 2.2, it's a huge miss by me. Therefore there's a reworked update cycle for the whole system, to both give smoother movement to particles and ensure updated rebirth positions current frame. It all goes into a toggle you can find in Advanced > Misc > Sync Particles To Main-Thread.
    Soon available! :)
     
    hopeful likes this.
  48. I_Dont_Know

    I_Dont_Know

    Joined:
    Oct 14, 2014
    Posts:
    3
    Aight, already one step ahead then ;) I'm updating the mesh position in LateUpdate however, will it still work correctly? I could probably change that though.
     
  49. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    That will work, the vertex extraction when Force Update On Main-Thread is enabled and particle setter is living in LateUpdate as well. You may need to change the Edit > Project Settings > Script Execution Order to make your script run before Playground though.
     
  50. I_Dont_Know

    I_Dont_Know

    Joined:
    Oct 14, 2014
    Posts:
    3
    Ah great! Tack så mycket! :) Another thing btw, it would be nice when emitting from script to include an option for also emitting every child playgroundparticle as well. Basically so you wont have to loop through every one by your self if you have a burst system with children for example, just though it would be nice cause I'm lazy. If it doesn't already exist?