Search Unity

Particle Playground

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

  1. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Wow that's great, I'll give it a try after PAX East, thanks !
     
  2. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Ok, the first tip solved the problem, I changed the static variable and everything is running well on the editor, thanks man a lot !!!
    oh by the way, why don't you add this static variable to your settings so the user can change it?
    Edit: You should at least tell the user something is wrong on the console.
     
    Last edited: Mar 5, 2015
  3. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Ah sorry, gotchya, will look into it.
    A preset is basically a prefab+icon presented in the Playground window, they're more of a concept. Earlier it had to be a particle system but nowadays the preset can be any GameObject. When you create a preset it will be tagged as "User" and stored in Resources/Presets for quick access during runtime. The "Example" presets are not exported to your build unless already instantiated or assigned through a variable. They also serve for easier exporting if you wish to share/publish your particle systems, where the exporter will strip out the full framework.
    You don't need to use presets in your project, you could also work with prefabs directly as usual in Unity.

    There's plans to improve the functionality regarding presets in the future to categorize things better and improve exporting, especially now when extensions are starting to pop up. If you have any requests in that area it would be nice to hear about how we could improve it.

    Alright great! A static variable won't serialize that way, hence the search is needed if the path doesn't exist. Playground would always need to find the settings file one way or another. Right now this should only be an issue if you have a gigantic project and have moved the assets, but I'll add a notification. Let me see if I can improve the search pattern to get around this.
     
  4. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey! Don't miss the Community Art Challenge this month, there's a chance to win Particle Playground and Sketchfab Pro!
     
  5. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    I can't get the 'State Target' to work with a texture. I am trying to get the particles to flow into formation of the logo. I can get the 'State Target' to work with a mesh. But not a texture. Could someone please please help me or upload an example?

    I am basically trying to replicate this:
    http://www.polyfied.com/development/unity/pixeltoparticles/webplayer.html
     
    Last edited: Mar 10, 2015
  6. frontakk

    frontakk

    Joined:
    Jan 8, 2011
    Posts:
    292
    I'm update FT ImpactEffect vol01 to ver1.7 !
    Easy to change particle size, lifetime and color.
    I was helped by save and pp community member.
    Thanks!:)

    And now updating FT magiceffect vol2...
     
    Exeneva likes this.
  7. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Some things I can think of:
    - Check that the texture is set to Read/Write Enabled in its Import Settings.
    - Make sure the State Scale is set to a small value unless you're using 1 pixel = 1 unit measure. Otherwise it might just simply be too large to see where the particles end up.
    - Disable Only Position In Range, that will otherwise stop particles from targeting when the state's pixel positions is outside the Manipulator.


    Very awesome, looking forward to it!
     
  8. frontakk

    frontakk

    Joined:
    Jan 8, 2011
    Posts:
    292
    Hi.
    I find problem.:(
    Use time event particle and set the value of collision lifetime loss,
    particle is continied(loop switch is off)...
    I set the value like this picture.
    Use PP version 2.23.
    shot_150312_170313.png shot_150312_170319.png
     
  9. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Oh darn, that is one deeply nested feature you're using. Thanks for reporting it in, I'll try to fix this ASAP!
     
  10. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Version 2.24 is out, adding a Math Manipulator to apply common math operations to particle properties.
    Basically this lets you:
    • Position
    • Apply force
    • Size
    • Rotate
    by:
    • Sine
    • Cosine
    • Linear interpolation
    • Adding
    • Subtracting
    using:
    • Value (float/Vector3)
    • Rate (float/Vector3)
    with ability to:
    • Clamp in value (property value particle is having before)
    • Clamp out value (new calculated value to apply)

    I hope that made sense! :) Here's one scenario (using size, sine, value: 1, rate: 5)


    You'll also find a new section in the Playground window called Extend Your Playground. This space is for you to fill! More about how to apply soon.
     
  11. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Version 2.25 is released addressing this particular issue, sorry about that. I also implemented further nesting a death event afterwards, all should be good to go. Let me know how it works out!
     
  12. frontakk

    frontakk

    Joined:
    Jan 8, 2011
    Posts:
    292
    Yes, it's perfect for me!
    Very thanks quickly update;)
     
  13. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    I have 2 particle systems in the manager but they are competing for which is "on top", blinking back and forth...

    I would like to blend them (additive would be great). Is that possible? I set their sorting layer numbers but --

    Nevermind. My "top" system was set to sorting layer 0. Setting it to 1 fixed it.
     
  14. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    One simple question here.
    Is there any way to create an attractor with a mesh (not skinned let's say) as the source of attraction? Right now its a simple transform, but I really would like to attract particles to vertex from a mesh like the inverse of creating particle from a mesh and attract them to a transform.
    Let me know if I'm not that clear, I can barely understand what I've written here :D

    Thanks !
     
  15. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Take a deep breath :p
     
  16. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Damn french troll :D
     
  17. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    You're surrounded. :D
     
  18. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Very awesome!

    Haha! No worries and yes you can use the Property Manipulators:
    • Mesh Target
    • Skinned Mesh Target
    • State Target
     
  19. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Oh nice I didn't try it, thanks a lot !
     
  20. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    Are these CPU or GPU particles?
     
  21. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    I would say it's CPU but I might be wrong.
     
  22. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    One "little" issue with your plugin.
    When I change the manipulator to property, select the mesh target property and set the mesh target everything works well. But if after that I decide to change the lifetime particles my editor will freeze for like 15 sec and then will lag a lot until I delete the object from the scene. If I set the particle lifetime before setting to mesh target it won't freeze anymore. So I can work around but yeah I thought it might be great to tell you about that.
     
  23. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Oh yeah and one more thing, I don't see currently where to change the color property name on your system. If I decided to change the shader of particles to let's say "Standard" the alpha color won't be tweened anymore. How do you know which property you have to tween on the material? That would be great to have an option to choose the property we want to tween (a simple string field).
     
  24. Taurris

    Taurris

    Joined:
    Aug 13, 2012
    Posts:
    14
    Hi all,
    I wanted to ask if it's possible to do certain thing in PP.
    I need particles to be spawned from origin in orientation based on the actual emitter. Just where Z points, there the newly birthed particles are facing to. You can imagine it as a flamethrower. But I need the particles to be oriented, so that I can use "oriented texture" as well. I hope that it makes sense.
    I was thinking about scripting the particles at birth to match orientation of the emitter, but it always helps if there's already working solution.
     
  25. frontakk

    frontakk

    Joined:
    Jan 8, 2011
    Posts:
    292
    Hi I'm update FT Magic Effect02.:)
    Added beam and magic projectile effects made by PP!
     
  26. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    They're CPU calculated across the available/specified cores.

    Great you reported that in, I'll have a look at this for next update.

    I'm afraid we can't access that, the Shuriken particles uses the vertex color in its meshes so your shader must support that. I'm unfortunately not great at shaders so there might be some kind of workaround I'm not seeing though.

    Hi! Could you possibly do a quick sketch or explain a bit more in detail on how the orientation works? Having a hard time grasping the concept. :)

    Just awesome!
     
  27. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Welcome to the reconfigured Particle Playground site! Now with a lot of video tutorials, there will be even more quite soon. There's also finally a good space for you to showcase your projects and expansions. :)
     
  28. Taurris

    Taurris

    Joined:
    Aug 13, 2012
    Posts:
    14
    Sure, the idea is quite simple. I'm working on a wake system for boats atm. I need to use horizontal billboards, which are oriented .
    I need the particles that are spawned to be oriented based on a parent/emitter orientation.
    Right now, I'm using Shuriken for that, because didn't find an easy way to modify PP particle rotation by script.
    But I just update rotation of newly created particles, to match the emitter. -> this way, I can easily use sprite sheets for the wakes for ex.
    I hope it makes sense now :)
     
  29. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Alright, I'll live with it.
    One more question, when I select the manipulator type to Property and then select the Mesh Target property, I have some control over the target sorting, and that's great ! But is it possible to have the nearest neighbor as an option here? On the mesh emitter we have this option, it would be great to have this one here as well :) Thanks !

    Edit: And an option to "downsample" the number of spawned particles? Right now I have to spawn the exact same amount of particles as my target mesh has. I would like to set like 4 x less particles and so hit only 1 vertex per 4 ones (same option as when you have a mesh emitter).
     
  30. Mike_Gardiner

    Mike_Gardiner

    Joined:
    Mar 21, 2015
    Posts:
    2
    Apologies if this has been answered, but is it possible to manually set a certain number of particles at certain world positions in code? I'm thinking of rolling out a point cloud solution using particles, with each particle representing each point.

    The input data would likely come in the form of x,y,z coordinates and possibly a colour too, so in an ideal scenario I'd be able to parse the info into PP and generate individual particles for each point.

    Bonus points if each particle could have a unique colour too!!

    Thanks
     
  31. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Try using two transforms as your Source parented to your boat, each slightly rotated around the y-axis:

    Then have a slight Local Initial Velocity:


    This way you will get the rotation automatically set by your boat and emit in the specified direction (where you easily can create the sort of visual V-effect you're after). You can also have a small Repellent Manipulator which creates this type of wake effect.

    I'll look into that, sounds like it would open up for some interesting scenarios! :)

    Yes it is! You can emit particles from script with some diverse overloads. You'll find emission examples in the 'Examples' folder and having a look in the FAQ will probably give you answers to some of your questions in relation to scripted emission.

    To change a particle's unique color you can fake that it has been affected by a Color Manipulator through the Playground Cache and then give it any type of color you wish over time.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class SetUniqueParticleColor : MonoBehaviour {
    6.  
    7.     PlaygroundParticlesC particles;
    8.     float lastUpdate;
    9.  
    10.     IEnumerator Start ()
    11.     {
    12.         // Cache the particle system component
    13.         particles = GetComponent<PlaygroundParticlesC>();
    14.  
    15.         // Wait for the system to become ready
    16.         while (!particles.IsReady())
    17.             yield return null;
    18.  
    19.         // Emit particles with lifetime of 100 seconds
    20.         for (int i = 0; i<particles.particleCount; i++)
    21.             particles.Emit (new Vector3(i,0,0), 100f);
    22.  
    23.         yield return null;
    24.  
    25.         // Set the particle to mimic affect from a Property Color Manipulator
    26.         particles.playgroundCache.changedByPropertyColor[0] = true;
    27.     }
    28.  
    29.     void Update ()
    30.     {
    31.         // Update color each second of the first particle
    32.         if (Time.time>=lastUpdate+1f)
    33.         {
    34.             particles.particleCache[0].color = NewColor();
    35.             lastUpdate = Time.time;
    36.         }
    37.     }
    38.  
    39.     Color32 NewColor ()
    40.     {
    41.         return new Color(Random.Range (0, 1f), Random.Range (0, 1f), Random.Range (0, 1f), 1f);
    42.     }
    43. }
    44.  
     
    cAyouMontreal likes this.
  32. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Yes thanks a lot ! I'm trying to create a "teleport" object effect, and this will help me for sure :)
     
  33. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    OnePxl likes this.
  34. victor874

    victor874

    Joined:
    Jan 20, 2015
    Posts:
    4
    Hey Save i have a quick question, I've run into an issue where if i use a new particle system for one thing, then create another for something else both of them share the same particle texture. This does not occur with the presets you have included, only with newly created systems. Is there some option i have to check in order to use different textures for each particle system
     
  35. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey!
    Check that you're using a separate material for these systems. It sounds like you have changed the texture of the default material, could that be it?
     
  36. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744

    It's time!

    If you already have your license, you can always help spread the good news during the countdown at preferred social site from playground.polyfied.com! The more adopters now, the better for Playground in the long run. :)
     
  37. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Hi, I have a request (or maybe I need advice). In a recent project I was able to use Playmaker to access most of the emitters' options exposed in the inspector. I could easily drive their positions by moving their heirarchy objects around, but I could do a lot of otherthings too (prewarm, change the spread scale, change the total number of particles, etc). What I could not do is access any of the Global Manipulator settings. I could move the Manipulator around in the scene, but not control any of the parameters.... I guess my "request" is a script to be attached to the Manipulators that exposes the parameters, similar to how the emitters have a script attached that exposes most of their controls.

    And everyone should buy Playground during the sale. Just saying... :D It's awesome!
     
  38. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi!
    You can access the Global Manipulators through the Playground Manager (PlaygroundC), you should be able to drag that into the FSM of PlayMaker (and use the public variable manipulators).
     
  39. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Final reminder to all curious, pirates about to release, expanding companies and awesome indie devs.
    65% off for a very limited time ahead!
     
  40. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    LOL!
     
  41. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    181
    Hi

    Just bought this and am having a few problems. I am trying to simulate an underwater prop turning. So want emitters round the edges of the blades. I tried painting first. It looked good but the emitters did not turn with the prop. Then I tried adding multiple transforms ( about 30) around the edges of the blades.. This worked except the particle streams keep stopping. Any thoughts?
     
  42. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi!
    It sounds like the collider you're painting onto isn't the same as the propeller's transform that is rotating, could that be it?
    I'm not exactly sure what could be the issue with streams stopping, sounds like a setting (Particle Settings > Emission > Emission Rate or Particle Settings > Lifetime > Lifetime Emission) isn't set to full.
    You could also try to use a spline outlining its shape, then parent the spline to your rotating propeller transform.
     
  43. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Yeah, pirates everywhere.
     
  44. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    181
    Had a few problems with the spline - moving it to the right position. So now I have started with the Viral Spiral preset which is working OK. Could you give me some hints though of how to a) change the direction and b) change the speed? Thanks
     
  45. Taurris

    Taurris

    Joined:
    Aug 13, 2012
    Posts:
    14
    Hi again,

    Unfortunately this doesn't solve the issue with orientation of the particles. Or I'm missing something :)
    This is what I get :
    particle orientation 01.jpg
    I need to have those arrow pointing along the axis they are spawned (Y in this case).

    My second question similar, as I would need to create a spline, but make the particles oriented perpendicular to that spline and have the velocity, perpendicular to that spline as well. I'm only getting this atm :
    particle orientation 02.jpg

    Any ideas on how to achieve this with PP ?
    Thank you.
     
    Last edited: Mar 27, 2015
  46. Chans

    Chans

    Joined:
    Jul 3, 2013
    Posts:
    1
    hello. I'm using playground particle very well.
    I have one question.
    When using particle, I can make synchronized particles using "RandomSeed" on Shurenkenparticle.
    Did playground has a system like that?

    I have to do synchronization operations on multiple PC for my work.

    Thank you.
     
  47. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    To change direction, try to inverse the Z curve and the Position Scale curve. The speed is controlled by a particle's lifetime as the Lifetime Positioning is a normalized value of that (1.0 on a curve means full lifetime).
    You should however be able to create some more dynamic behaviors using a rotating Source which doesn't have any Force Annihilation applied, perhaps make use of Forces > Initial Velocity > Delta Movement.
    Let me see if I can make a video tutorial about this soon.

    I see! As long as the particles are moving you can make use of Particle Settings > Rotation > Rotate Towards Direction. Otherwise you would have to roll your own logic for their individual rotation. There is a function called SignedAngle in PlaygroundParticlesC which you can use to create a rotation around a normal plane. The framework is using it this way:
    Code (CSharp):
    1. playgroundParticles.playgroundCache.rotation[p] = playgroundParticles.playgroundCache.initialRotation[p]+SignedAngle(
    2.     up,
    3.     playgroundParticles.playgroundCache.position[p]-playgroundParticles.playgroundCache.previousParticlePosition[p],
    4.     playgroundParticles.rotationNormal
    5. );
    But you can use it to roll your own rotation logic, for example based on a spline's velocity. There's some code examples on the Playground Spline page.

    Hi! This is not implemented but a good question, I'll look into adding such feature. You could try making internalRandom01 (line 807 in PlaygroundParticlesC.cs) a public variable to then reuse the same System.Random.
     
  48. ShinKazuo

    ShinKazuo

    Joined:
    Oct 28, 2014
    Posts:
    12
    Hey! I bought the playground last weekend and I'm having a lot of fun playing around with it!

    I do have a question though: I'm working on a top-down game in which I can instantiate a particle system that spreads around a bunch of circles (blood droplets). I'm trying to get the particle system to tell me the final location of each one of the particles (or the average final position of all of them) so I can instantiate a blood texture on the floor as if that droplet fell there and now there is a small pool of blood.

    I tried using the event listener but I couldn't declare it in the start function: I don't have any reference about the blood particles until I actually spawn it when the player dies in the game! I might be doing this wrong, I'm not the best programmer out there.
     
  49. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi, awesome! :)
    The easiest way to track particles in this case would be to setup a death event with "Send To Manager" enabled on the particle systems that is emitting blood.


    Then you can use a script which is listening to the Playground Manager's death event and add their position to a list whenever that occurs. It could look like this:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using ParticlePlayground;
    5.  
    6. public class TrackParticleDeath : MonoBehaviour
    7. {
    8.     public static List<Vector3> deadParticles = new List<Vector3>();
    9.  
    10.     void OnEnable ()
    11.     {
    12.         PlaygroundC.particleEventDeath += OnParticleDeath;
    13.     }
    14.  
    15.     void OnDisable ()
    16.     {
    17.         PlaygroundC.particleEventDeath -= OnParticleDeath;
    18.     }
    19.  
    20.     void OnParticleDeath (PlaygroundEventParticle particle)
    21.     {
    22.         deadParticles.Add (particle.position);
    23.     }
    24.  
    25.     public static Vector3[] GetDeathPositions ()
    26.     {
    27.         return deadParticles.ToArray();
    28.     }
    29. }
    Whenever you want to read and work with the death positions you can call:
    Code (CSharp):
    1. Vector3[] deathPositions = TrackParticleDeath.GetDeathPositions();
    2.  
    3. // Example use
    4. for (int i = 0; i<deathPositions.Length; i++)
    5.     Debug.Log (i+" particle died at "+deathPositions[i]);
     
  50. EricGree

    EricGree

    Joined:
    Jan 30, 2015
    Posts:
    3
    Hey Save,

    Is there any plans to have something similar to Shuriken's Duration (duration the Particle System will be emitting particles)? It would be great where I can specify the duration of the particles being emitted without affecting the life of the particles themselves. For example. a stream of flames for 2.5 seconds and the flames themselves last for 1.2 seconds.

    Also, is there a plan for a Start Delay like in Shuriken? The Lifetime Offset can only do so much because it's limited to the life of the particle. If a particle's life is only 1.0 second but I want to delay it for 3.0 seconds before it spawns.