Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Particle Playground

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

  1. RavenMikal

    RavenMikal

    Joined:
    Oct 18, 2014
    Posts:
    144
    It did make sense...and honestly, explains alot...So, yea, going to run with your suggestion tonight to see if I can't get the same effect I'm going for, and the way your describing it, I think that should work pretty well. I'll try it tonight and tell you how it works out. =)

    Thanks Save

    P.S.~ actually, may look way cooler then what I had originally planned, definition of a badass workaround...lol. Will take a mini video with camstudio when its done and give the link
     
    Last edited: Oct 25, 2014
  2. Ennothan

    Ennothan

    Joined:
    Oct 17, 2013
    Posts:
    51
    Hey There,
    I couldn't find nothing about texture sheet animation on the inspector, so I checked to show shuriken, with that I managed to change the tiles but the Frame over Time always keep with the linear line and 32 frames no matter what I do.
    There is a configuration for this and I just tired for no see it or that are a real bug?
     
  3. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Great! Looking forward to see it. :)

    Hi!
    Good you found your way in there, the one part which we're stuck with not lifting out to the Playground's Inspector.
    Could you explain a bit more in detail how the Texture Sheet Animation is setup on your side?

    Testing it out with these settings:

    With a texture looking like this:

    Produces this particle:
     
  4. Nezabyte

    Nezabyte

    Joined:
    Aug 21, 2012
    Posts:
    110
    Is there a prewarm option? Having trouble finding it.
     
  5. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Sorry there is no true prewarming (yet). You can many times use the snapshot function with Load From Start enabled instead, that will make the particle system instantly start with live particles within the scene.
     
  6. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    hopeful likes this.
  7. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    Hi,

    First great plugin, I like it :)

    I have problem to do working playground windows when I move the root directory from /Asset to a sub-Directory.
    Even when I modify the path in the particle playground window.
    It's a bug or it's not possible ?
     
  8. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi, awesome!
    I'll rewrite that part so everything is based upon the settings file, I noticed it's currently a catch 22 in how it sets its absolute path. To quickly fix it you could edit the playgroundPath string in PlaygroundParticleWindowC.cs on line 15:
    Code (CSharp):
    1. public static string playgroundPath = "Parent folder/Particle Playground/";
    A small update fixing this is coming asap.
     
  9. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    Great ! Thanks


    I already tried to change this path but it creates new errors
     
  10. Ennothan

    Ennothan

    Joined:
    Oct 17, 2013
    Posts:
    51
    I got it now, looking to your screens, the "Playground Particles" session of the Playground Particles C script needs to be folded in the inspector when changing this, otherwise it doesn't work.

    Thanks save
     
  11. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Understood, the issue is probably because the variables are already stored and doesn't re-initialize (and makes you have to reload the Unity window layout, quite nasty!). Update sent, should be available any minute. Let me know how that goes, you should get a message in the Playground Window that your path is incorrect, at the very bottom you should see the paths unfolded. Edit "Playground Path" to match where you've placed it and once the path is correct it should automatically import all presets.

    Ah interesting, thanks for getting back to me, which version of Unity and Particle Playground are you on?
     
  12. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    it's work ! :)
     
  13. Ennothan

    Ennothan

    Joined:
    Oct 17, 2013
    Posts:
    51
    I'm using 2.11.
    I got another question now, how control the emission duration independent of the lifetime? I want to create a short emission duration, but longer than just a burst with a long lifetime.

    Edit: And why particles are faster in play mode than editor, I do exactly the speed I want in editor and when I hit play everything moves faster.
     
    Last edited: Oct 27, 2014
  14. RavenMikal

    RavenMikal

    Joined:
    Oct 18, 2014
    Posts:
    144
    Rofl! I give up, I'm stumped! well for now... >.<

    So, I was going through the code looking for where to put my mesh,
    I'm hoping I found the wrong place...lol

    At first, I thought you had used a primitive, then realized it was spelled different, and in the class its drawn to a VRML 2.0 detail >.<

    so, with that said, how do I
    A) assign a pre existing mesh
    or
    B) how do I get the Vertices/Face info from my Mesh to do it manually...

    As always, your assistance is greatly appreciated =)

    P.S. - will be adding the update tonight, and look forward to the videos =)
     
  15. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Great!

    If I understand correctly you could add a script which sets emission to false after yielding the amount of time you want. Keep in mind the lifetime sorting will determine when each particle birth during your set lifetime.
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. /// <summary>
    6. /// Stop emission after waiting N seconds. Put this script onto your particle system.
    7. /// </summary>
    8. public class StopEmissionAfterWait : MonoBehaviour {
    9.  
    10.     public float timeToWait = 1f;
    11.  
    12.     IEnumerator Start () {
    13.         PlaygroundParticlesC particles = GetComponent<PlaygroundParticlesC>();
    14.         yield return new WaitForSeconds(timeToWait);
    15.         particles.emit = false;
    16.     }
    17.  
    18. }
    19.  
    There's two possible causes I can think of if you experience particles running faster between Editor and Play mode. In 2.11 there's a possibility of accidentally adding several Playground Managers by instantiating it as a prefab. Try updating to the latest to make sure that doesn't happen. Another cause could be that your particle system is loading its prefab values and it resets with another lifetime or animation value. In case none of those applies, could you send me the particle system in a UnityPackage so I can have a look at what's going on? You could send it to support@polyfied.com in that case.

    Is it the skinned mesh you want to add to the target manipulator? All assigning of meshes can be done through the Inspector, then you can enable/disable the manipulator whenever you want it to start attracting towards your skinned mesh.
    Through script you create and refresh World Objects and Skinned World Objects by their GameObject reference.
    Here's a basic example of calling both manipulators and sources to refresh onto a new GameObject:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class ChangeWorldObjects : MonoBehaviour {
    6.  
    7.     public GameObject sourceWithMesh;        // The source you wish to create birth or target positions from
    8.     public PlaygroundParticlesC particles;    // The particle system reference
    9.     public int manipulatorId;                // The list position of your manipulator
    10.  
    11.     /********************************************************************************
    12.         Changing manipulator target
    13.      *******************************************************************************/
    14.  
    15.     /// <summary>
    16.     /// The mesh target property of a manipulator can be set by SetMeshTarget(GameObject).
    17.     /// </summary>
    18.     void SetManipulatorMeshTarget () {
    19.         particles.manipulators[manipulatorId].property.SetMeshTarget(sourceWithMesh);
    20.     }
    21.  
    22.     /// <summary>
    23.     /// The skinned mesh target property of a manipulator can be set by SetSkinnedMeshTarget(GameObject).
    24.     /// </summary>
    25.     void SetManipulatorSkinnedMeshTarget () {
    26.         particles.manipulators[manipulatorId].property.SetSkinnedMeshTarget(sourceWithMesh);
    27.     }
    28.  
    29.     /********************************************************************************
    30.         Changing source birth positions
    31.      *******************************************************************************/
    32.  
    33.     /// <summary>
    34.     /// To change a Source: World Object's birth positions you set another GameObject reference, this will trigger a refresh of the vertex and normal arrays.
    35.     /// </summary>
    36.     void SetSourceMesh () {
    37.         particles.worldObject.gameObject = sourceWithMesh;
    38.     }
    39.  
    40.     /// <summary>
    41.     /// To change a Source: Skinned World Object's birth positions you set another GameObject reference, this will trigger a refresh of the bones, vertex and normal arrays.
    42.     /// </summary>
    43.     void SetSourceSkinnedMesh () {
    44.         particles.skinnedWorldObject.gameObject = sourceWithMesh;
    45.     }
    46. }
    47.  
    Hope it helps, at least in explaining the methodology of how to attack the problem, otherwise feel free to ask (script sample from your side with how you've approached it helps in that case). :)
     
    Last edited: Oct 27, 2014
  16. RavenMikal

    RavenMikal

    Joined:
    Oct 18, 2014
    Posts:
    144
    Your the best, Save, will let you know. :cool:
     
  17. Ennothan

    Ennothan

    Joined:
    Oct 17, 2013
    Posts:
    51
    For stopping emission I did that after posting :p, and for the faster particles in play mode it was exactly what you said, 2 playground managers.
    Everything is perfect now.

    Thanks Save
     
  18. Mack033

    Mack033

    Joined:
    Oct 28, 2014
    Posts:
    1
    hi,i want to Kill a particle,so i use " public void Kill (int p) " ,but can't delete the particle.
     
  19. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Ahh the list of previous bugs beg to differ, at least they get fewer... :) Great!
    Great, let me know if you need anything else down the road!
    Hi!
    What does your current script look like and how is the particles lifetime set? As an example to kill particles through script using Kill (int),
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class KillParticles : MonoBehaviour {
    6.  
    7.     PlaygroundParticlesC particles;
    8.     int index;
    9.  
    10.     void Start () {
    11.         particles = GetComponent<PlaygroundParticlesC>();
    12.  
    13.     }
    14.  
    15.     void Update () {
    16.         if (Input.GetMouseButton(0)) {
    17.             particles.Kill (index);
    18.             index = (index+1)%particles.particleCount;
    19.         }
    20.     }
    21. }
    22.  
    Does that work on your end?
    You could also use a Manipulator with the death property if it's a particle in certain world space.
     
  20. dumaike

    dumaike

    Joined:
    Sep 4, 2013
    Posts:
    7
    Hey Everyone,

    I'm trying to build an Asset Bundle (http://docs.unity3d.com/Manual/AssetBundlesIntro.html) that has a particle playground effect in it. In my core application, when I load in the GameObject that contains the Particle Playground effect, all the particles are pink blocks. It looks like the materials aren't being correctly bundled or loaded. Maybe it's a problem with recognizing dependencies?

    Are there are guidelines I should be following. Can I put your particles in an asset bundle?

    Thanks
    DuMaiKe
     
    Last edited: Oct 28, 2014
  21. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey DuMaiKe, sure sounds like there's dependency issues. Have you checked out this UA: http://answers.unity3d.com/questions/21136/missing-textures-materials-in-asset-bundle.html
    I'm yet unaware of how to work with asset bundles but let me know if you continue to experience issues and I'll do some testing.
    The material of a Particle Playground system is directly linked to the Shuriken material, so if you need to set it again it could be done like this:
    Code (CSharp):
    1. yourParticleSystem.particleSystemRenderer.sharedMaterial = yourMaterial;
     
  22. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Don't forget to let me know if you're using Playground in your projects. Looking at support there's plenty of really cool projects in the making and I'm looking for promoting them once you're ready. ;)
     
  23. dumaike

    dumaike

    Joined:
    Sep 4, 2013
    Posts:
    7
    Hey Save,

    Thanks for the speedy response. It turns out the problem wasn't related to particle playground at all, but a deployment shader issue. I was exporting asset bundles for Android and iOS (our eventual deployment targets), but developing the game on a PC using the editor (obviously). Unity only loads common shaders for the target platform you're on, so the shaders didn't exist for Windows when I tried to run the game in my Editor. Our game is 2D and you don't get this issue with SpriteRenderer objects so we just hadn't seen it until using particles.

    The solution is just to create Windows and Mac asset bundles for development purposes only. Your stuff is still working great. =)

    We're using particle playground in our project, but we're really far from anything public right now. When we're getting closer to a launch I'll definitely give you a PM.

    Cheers,
    Mike
     
  24. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi Mike!
    Great stuff, thanks for getting back with the info. Sure thing, whenever you're ready to showcase!
     
  25. Jonathan-Bro

    Jonathan-Bro

    Joined:
    Apr 11, 2013
    Posts:
    35
    Hi Save,

    I updated to v2.13, but I'm still seeing the problem. I'm including my manager settings, maybe there is something set up wrong? I ran my simulation again and made another GIF so you can see the problem again. http://imgur.com/Z9lmGt8

    Thanks for all the help!
     

    Attached Files:

  26. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey!
    Try with setting the Lifetime Sorting to Burst, that should set the first spawning particle at the current global time. If you intend to simulate one particle per system you could instead use the Source: Script mode and Emit() at your positions to simulate all particles within one system. Not sure if that would work for your intended solution in the end but it's a thought!
    As I'm testing the method of instantiating particle systems the way you've set them up I'm noticing a couple of issues in relation to bulk creating/destroying them, a fix is on its way there.
     
  27. RavenMikal

    RavenMikal

    Joined:
    Oct 18, 2014
    Posts:
    144
    Save, I unistalled 4.6 beta, installed 4.5.4, and I've reimported playground, but its not registering...it doesn't show as an option in windows...what happened?! what did I do?! why, unity, why?!! lol...sorry. Kay, yea,what did I do wrong?
     
  28. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    I'm not sure what could have happened, downgrading is always a bit shaky. Try Assets > Reimport All on your project. If that doesn't work try removing the Particle Playground folder completely and reinstall by using the Asset Store import button. Any luck with that?
     
  29. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey again Jonathan,
    As a followup to your particular problem. I've spent some time going through how a particle system launches and how multithreading handles that. Result is promising (based testing on your previous images),


    This is the script for above to happen:
    Code (CSharp):
    1. using UnityEngine;
    2. using System;
    3. using System.Collections;
    4.  
    5. public class InstantiateAlongInput : MonoBehaviour {
    6.  
    7.     public GameObject particleSystemPrefab;
    8.     public InstantiationPosition[] positions;
    9.    
    10.     void Update () {
    11.         if (Input.GetMouseButton(0)) {
    12.             Vector3 mousePos = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 10f));
    13.             for (int i = 0; i<positions.Length; i++) {
    14.                 if (mousePos.x>positions[i].pos.x && !positions[i].enabled) {
    15.                     Instantiate (particleSystemPrefab, positions[i].pos, Quaternion.identity);
    16.                     positions[i].enabled = true;
    17.                 }
    18.             }
    19.         }
    20.  
    21.         if (Input.GetMouseButtonUp(0)) {
    22.             for (int i = 0; i<positions.Length; i++)
    23.                 positions[i].enabled = false;
    24.         }
    25.     }
    26.  
    27.     void OnDrawGizmos () {
    28.         for (int i = 0; i<positions.Length; i++)
    29.             Gizmos.DrawWireSphere(positions[i].pos, 1f);
    30.     }
    31. }
    32.  
    33. [Serializable]
    34. public class InstantiationPosition {
    35.     public Vector3 pos;
    36.     public bool enabled;
    37. }
    Where the particle system is using non-looping particles with destroy on done and the lifetime sorting is set to burst.
    I'm currently polishing this a bit but you could expect a fix up by tomorrow.
     
  30. RavenMikal

    RavenMikal

    Joined:
    Oct 18, 2014
    Posts:
    144
    Save,

    Update!

    Yea, had to uninstall then go back and delete the Unity folder,

    tried it with 4.5.5, is working fine, so now I can get back to my other issue....lol.
     
  31. RavenMikal

    RavenMikal

    Joined:
    Oct 18, 2014
    Posts:
    144
    Save, I spoke to soon...lol...I was debugging a test script, it opened unity, and p2 died right then mid unity session....
    I'm thinking it has something do with 4.5.5, so I'm going to delete everything again and just reinstall 4.5.4 >.<
     
  32. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Alright, let me know how it works out. I've been testing on 4.5.5 quite a lot today and it seems to run as intended.

    One issue found is building the app for x86_64 architecture on Mac OS X (tested in Yosemite), it does not seem to cope well with multithreading. Running on x86 should still be fine though. I'm not sure yet if this applies to any .NET/Mono multithreaded application with 64bit architecture on Mac OS X or if I can do something differently.
     
  33. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
  34. RavenMikal

    RavenMikal

    Joined:
    Oct 18, 2014
    Posts:
    144
    Okay, got it back to 4.5.4, all is well there, and for that matter, as a side note, 4.6 Beta didn't give me issues with P2 either,

    My system is running Win 7 32 bit, and maybe it was something to do with my personal software/hardware settings, just this side of a one off, but it happened twice, the first when I first installed 4.5.5 and P2 wasn't taking, the second after that was fixed and I clicked "start debugging" in mono, after debugging Unity would flash, the Playground window would dissapear, all the playground scripts show to have compile errors in the inspector, and no scene will play with a Playground Particle system.

    On another note, much happier and stupider one, I finally found where to set skinned mesh object in the UI, I had never picked "Combination" for type >.< slick, I know...lol

    felt kind of stupid, but in trying to figure this out I've at least figured out the script controls for it, so thanks for that =)
    Will need to play with the timing of enabling, and animating the strength of the manipulator, as well as the timing of the particle system itself to get the look I'm going for, but will post when it's finally complete. ;)

    Thanks again, Save.
     
  35. Ennothan

    Ennothan

    Joined:
    Oct 17, 2013
    Posts:
    51
    Hello Save,
    I was playing with the viral spiral preset, and was thinking if there is a way with the lifetime positioning active to emit particles starting in the origin and rotating through the lifetime, because when we check it to emit it emit all at once, I want to emit spiraling as it does when you stop emission and it goes down spiraling till the end.
     
  36. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    Just tried importing the latest release to a new Unity 5 beta project and having some compile errors.

    Any idea on a timeline for support for Unity 5?
     
  37. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Don't worry. With Save you will be..safe. :p
     
  38. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    schmosef what platform are you running it on ? The latest version works fine for me on unity 5 beta 9 with the windows 64 bit version. If anything it runs better than it did on Unity 4. You might want to try reimporting it from the asset store and run the conversion again. One of my other packages failed to compile in the beta giving compile errors that didn't make sense but then I re imported it and it compiled OK.
     
    schmosef likes this.
  39. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    I'm using Windows 8.1 x64 with Unity 5b9 x64.

    I deleted and re-imported the asset and this time a message window popped up asking if I'd like to automatically update some of the scripts (it did not ask me this before).

    I clicked the ok button (I think the button text was something like "go ahead, I have a backup") and now Particle Playground works without compile errors.

    I guess that's what you meant by "run the conversion again".

    Thanks for the tip.
     
  40. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    It's great you report in any issues you think may be connected to Playground, even if it turns out not to be we can always try to help out. Oh don't feel stupid, I think this is an issue of there not being enough info material out yet - working on it. Great, looking forward to see!

    This is a bit of a tricky area as it's connected with the Lifetime Sorting methods and how particle time is calculated, which later affect rebirth values and events. I'd rate it the ugliest nested part of the framework which hopefully can be rewritten to something more clean and flexible as soon as I'm capable.
    One feature which should give you the result you're describing is scrubbing the Lifetime Offset the entire lifetime. If you start your particle system without any emission and call yourParticleSystem.Emit(true) you should see particles starting at the beginning (X, Y and Z zero) of your Lifetime Position. I can't guarantee it to be an entirely foolproof solution though as it may vary depending on your Lifetime Sorting and min-max lifetime settings.

    More flexibility in a future update, it's on the todo. :)

    Thanks for chipping in and getting back! Yup, Playground is Unity 5 ready. :)
     
    Last edited: Nov 2, 2014
  41. reptilebeats

    reptilebeats

    Joined:
    Apr 28, 2012
    Posts:
    272
    hey just thought i would mention as im sure more people will buy because of the discount, i did.

    i put it in my project and it said there was compiler errors when nothing was showing up in the console, don't know why but the way i got it to work was opening a new project importing it into that and then exporting it out as a new asset, and then placing it into my main project. works fine now. hell it would probably work for other stuff as well which has api upgrade problems.
     
  42. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey there! Any chance you remember the error message/can reproduce, and which version of Unity?
     
  43. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
  44. reptilebeats

    reptilebeats

    Joined:
    Apr 28, 2012
    Posts:
    272
    it was something to do with the save or something, i will re-import from the store and get it up.

    the strange thing is though that when i clicked clear on the console they were gone but i still couldn't click play in unity as it would say i had errors, might be a unity bug. it was unity 5 beta 11 latest one
     
  45. reptilebeats

    reptilebeats

    Joined:
    Apr 28, 2012
    Posts:
    272
    hi here is an image of the console, like i said though it works fine in a new project.
     

    Attached Files:

  46. reptilebeats

    reptilebeats

    Joined:
    Apr 28, 2012
    Posts:
    272
    forgot this bit to it.
     

    Attached Files:

  47. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Thanks for getting back with the info! Sure sounds like something the Unity 5 beta team should get a bug report about. ;)
     
  48. reptilebeats

    reptilebeats

    Joined:
    Apr 28, 2012
    Posts:
    272
    i'll make sure to do one, cool plugin though cant wait until i have some free time to give it a proper test
     
  49. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Awesome and thanks!
     
  50. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Hi. This is great, just bought it.

    How do shadows work in Particle Playground? I tried modify the "Playground Cubism" example, gave them a simple diffuse material and set Color Source to "Source", but they still don't seem to cast or recieve shadows even though they're meshes.

    I've heard that the default transparent Unity billboard shaders don't cast or recieve shadows, but that this can be fixed with custom shaders such as this (haven't tried it myself):
    http://answers.unity3d.com/questions/269292/having-an-invisible-object-that-casts-shadows.html