Search Unity

Particle Playground

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

  1. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Ok I see! You can emit from script. You can also try Source: Skinned World Object to see if that together with altering the Particle Settings will give you the result you're looking for. Although if you'd like to keep bursting from the same vertices while the previously emitted particles are still alive you would have to go a bit more manual. Here's a rough example of how you could approach it:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class ManualEmitFromSkinnedMesh : MonoBehaviour {
    6.  
    7.     public Transform skinnedMeshTransform;
    8.     public float emitRepeatTime = .5f;
    9.     public int vertexStep = 1;
    10.     public Color32 particleColor = Color.white;
    11.     public Vector3 particleVelocity;
    12.  
    13.     private PlaygroundParticlesC particles;
    14.     private SkinnedWorldObject swo;
    15.  
    16.     void Start () {
    17.  
    18.         // Cache the particle system (make sure you have set enough particle count)
    19.         particles = GetComponent<PlaygroundParticlesC>();
    20.  
    21.         // Create a new skinned world object
    22.         swo = PlaygroundC.SkinnedWorldObject(skinnedMeshTransform);
    23.  
    24.         // Start emission routine
    25.         StartCoroutine(EmitOverAllVertices());
    26.     }
    27.    
    28.     IEnumerator EmitOverAllVertices () {
    29.         while (true)
    30.         {
    31.             yield return new WaitForSeconds(emitRepeatTime);
    32.             swo.BoneUpdate();
    33.             swo.UpdateOnNewThread();
    34.             while (!swo.isDoneThread)
    35.                 yield return null;
    36.             for (int i = 0; i<swo.vertexPositions.Length; i+=vertexStep)
    37.                 particles.Emit(swo.vertexPositions[i], particleVelocity, particleColor);
    38.         }
    39.     }
    40. }
    41.  
    Keep in mind that you may need a fair bit of particles to cover all vertices (and any still living particles from those emitted vertices).
     
  2. FG_dev1

    FG_dev1

    Joined:
    Nov 3, 2014
    Posts:
    44
    Hi @save

    We're you able to resolve the "Fatal error in gc; too many threads" issue from this post?

    We've upgraded from PP2 to PP3 and are getting this error.

    Pretty much same process as that post:
    1. Delete v2 install
    2. Import v3 with Unity's download manager
    Loading scenes causes this hard crash. I've changed the max threads to 8 in the prefabs and in scenes where appropriate but it still happens. It seems to be editor only as builds seem fine.



    Was there a solution to this in the end?
     
    Last edited: Mar 10, 2016
  3. fastgamedev

    fastgamedev

    Joined:
    Mar 27, 2014
    Posts:
    79
    @save Happened on a regular package import from Asset Store.
     
  4. fastgamedev

    fastgamedev

    Joined:
    Mar 27, 2014
    Posts:
    79
    I made a Playground Spline with several nodes. I assumed that the up/down arrows to the right of each node would move it up/down in the list of nodes. But they do nothing. Is this a bug, or is there another purpose for these arrow buttons?
     
  5. Ylex

    Ylex

    Joined:
    Apr 9, 2012
    Posts:
    15
    Hi, does this asset have a particle collision messages which I can use from my code?
     
  6. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi,
    The solution has been to ensure using a low amount of threads (Playground Pool with Max Threads 8, just as you describe). Are you by chance using any other multithreaded components in your scene? If this keeps occurring it would be great to receive one of the scenes together with its dependencies in a project sent to support@polyfied.com.
     
  7. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Ok thanks!

    Here's steps to fix the anomaly formatted paths in Playground (which most likely is because of different encodings or line endings which can become wrongly converted upon import into Unity):

    1) Open Window > Particle Playground.
    2) Locate Settings > Paths (at the very bottom) which should look like this:


    An alternative option is to recreate the Settings file (which Playground can do automatically):
    1) Remove the asset Particle Playground/Playground Assets/Settings/Playground Settings.
    2) In Window > Particle Playground > Settings, press Create to generate a new Playground Settings file.
    3) Select the Playground Settings in Project View (found at the same location as in step 1) and set Languages array (found at the very bottom) to 1 and assign English at Element 0.
     
  8. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Ah sorry about that, it appears the function was never completed. :confused:
    You can download the updated spline array shifting feature here: https://dl.dropboxusercontent.com/u/20640491/PP_3.0.3_SplineArrayShifting.unitypackage

    Will also be in the next official update!
     
    fastgamedev and hopeful like this.
  9. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi @Ylex,
    Yes, Playground uses its own collision detection where you can use Events to listen to any colliding particles. Whenever a particle collides a PlaygroundEventParticle will be sent with all the data about the particle.

    Start listening to events on a single particle system is a really quick task:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class ListeningToPlaygroundEvents : MonoBehaviour {
    6.    
    7.     public PlaygroundParticlesC particlesToListenTo;
    8.     public int eventIndex = 0;
    9.     private PlaygroundEventC particleEvent;
    10.    
    11.     void Awake ()
    12.     {
    13.         particleEvent = PlaygroundC.GetEvent(eventIndex, particlesToListenTo);
    14.     }
    15.  
    16.     void OnEnable ()
    17.     {
    18.         particleEvent.particleEvent += DoSomethingOnParticleEvent;
    19.     }
    20.  
    21.     void OnDisable ()
    22.     {
    23.         particleEvent.particleEvent -= DoSomethingOnParticleEvent;
    24.     }
    25.    
    26.     void DoSomethingOnParticleEvent (PlaygroundEventParticle particle)
    27.     {
    28.         Debug.Log("Particle "+particle.particleId+" collided with collider "+particle.collisionCollider.name+" with a velocity of "+particle.velocity);
    29.     }
    30. }
    31.  
    You can also listen to all particle systems which has 'Send To Manager' enabled in their Events settings, if you for example have a whole lot of particle systems which you would like to track but don't want to setup each and every one manually. It can be done like this:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class ListeningToPlaygroundEvents : MonoBehaviour {
    6.  
    7.     void OnEnable ()
    8.     {
    9.         PlaygroundC.particleEventCollision += DoSomethingOnParticleEvent;
    10.     }
    11.  
    12.     void OnDisable ()
    13.     {
    14.         PlaygroundC.particleEventCollision -= DoSomethingOnParticleEvent;
    15.     }
    16.    
    17.     void DoSomethingOnParticleEvent (PlaygroundEventParticle particle)
    18.     {
    19.         Debug.Log("Particle "+particle.particleId+" in system "+particle.particleSystemId+" collided with collider "+particle.collisionCollider.name+" with a velocity of "+particle.velocity);
    20.     }
    21. }
    22.  
    Another thing available is listening to Manipulators which can track particles, that lets you get data about particles within a specified area. This can be of advantage when doing more interactive setups of your particle systems.

    There are examples in the package which covers all of this as well.
     
  10. Ylex

    Ylex

    Joined:
    Apr 9, 2012
    Posts:
    15
    Ok, thanks. :)
     
  11. dl_studios

    dl_studios

    Joined:
    Oct 14, 2012
    Posts:
    76
    @save Hi, How can I set the tint color on the particle? I've tried:

    Code (csharp):
    1.  
    2.   _myParticlesC.particleSystemRenderer.material.color = Color.green;
    3.      _myParticlesC.particleSystemRenderer2.material.color = Color.cyan;
    4.  
    Neither of which change the color. However, if I grab the materials tint and change it in the inspector the change is easy to see.

    So I'm not sure where I'm going wrong. My guess is that I'm not getting a hold of the correct material. Or is it a different issue? I'm not all that familiar with particle systems to begin with, so I might be missing something obvious.

    A related question, how would I change the particles texture at runtime? Would I simply get a hold of the material and change it's main texture?

    BTW, I'm loving particle playground! Amazing work! Thank you for making it!
     
    Last edited: Mar 22, 2016
  12. Silverlode

    Silverlode

    Joined:
    Apr 9, 2013
    Posts:
    41
    Hi there,

    I am having problem when running Particles Playground on iOS. I have a scene that works fine in the editor on PC. The scene has several textures, and when clicked (they are buttons) a PP prefab set to emit a burst of particles with the same texture as a source. The texture is 32x32 pixels, creating 1024 particles. I have uploaded the effect for you to see.

    However on iPad, there is a problem - its hard to describe so I've uploaded a video for that too. The particles don't seem to clear and they play very badly. I thought perhaps it was performance, so I ran it again with only 64 particles in total - same thing.

    To further attempt to diagnose the issue, I made a build containing only the "Logo Example (Mobile)" scene, and it also had what I think is poor performance - the particles updating in a strange / jittery way - also attached.

    Is there something I need to do to get this working on iOS?

    Unity 3.4.1f1
    iPad Mini 2 - iOS 8.3
     

    Attached Files:

  13. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    @save
    I'm implementing the dust emitted from a wheel while skidding and I need to change speed, quantity and size by code.
    The Emit method supports custom position, velocity and color, but not size scale.
    Is there a way to change by code the size of future particles that will be spawned without affecting the ones already visible?
    Thanks
     
    Last edited: Mar 26, 2016
  14. Partiest-Cat

    Partiest-Cat

    Joined:
    Jan 16, 2014
    Posts:
    8
    Hello! Our team has been having some troubles coming to a solution with an element in our game that until now we've been attempting to use Shuriken for, and I was curious if Particle Playground might be able to solve the problem!

    Our player character uses a flamethrower, and since Shuriken (seemingly) only has the ability to collide with objects and not check for triggers (onEnter, onExit, etc.), the individual flames emitted from the weapon collide, stop, and/or die upon reaching a target rather than shooting THROUGH the target to allow for damage checks on other targets behind it.

    Would Particle Playground allow for collision checks without actually stopping the individual particles in space? I looked through the manual and wasn't able to spot anything, but I'm pretty new to particles in general and I'm never sure if I've overlooked something important.

    Thanks!
     
  15. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Is there a way to immediately start a particle system as if it has been running for a while?

    I'm using PP with my GUI. So, when the window comes up... I want the effect looking like it's been running vs. waiting for all the particles to fill in and float.

    BTW... I'm loving PP. :)
     
  16. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    You will have to enable the prewarming option in the Advanced panel
     
    Tryz likes this.
  17. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi,
    If you want to change the tint of a material through script you'd have to use the SetColor function in the Material class.
    By looking at the specific shader you should find something like this:
    Code (CSharp):
    1.  _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
    Where you then could use this approach:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class SetParticleTint : MonoBehaviour
    6. {
    7.     public PlaygroundParticlesC particles;
    8.     public string tintPropertyName = "_TintColor";
    9.     public Color32 tintColor;
    10.    
    11.     void Update ()
    12.     {
    13.         particles.particleSystemRenderer2.sharedMaterial.SetColor(tintPropertyName, tintColor);
    14.     }
    15. }
    16.  
    For changing particle color directly you could use an infinite sized Color Manipulator (which can transition the color automatically over time if you'd like).

    Nice to hear that you're enjoying it!
     
  18. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi,
    Thanks for the videos. Which version of Particle Playground are you using? It's a bit unclear which Unity version you're using (I'll assume it's 5.3.4). In comparison to other iOS titles using Playground on low-end devices (such as Pixel Garden) something is definitely not right, but very hard to pinpoint what could be the cause. It could be a bug with that specific device and iOS version, which could have trouble executing multithreaded code.

    Could you try connecting the Unity profiler to Xcode to see what is hogging performance? (Also an Instruments check to see how the CPU is working on device.)

    In case this is a multithreading issue you could also try running without the Simplex turbulence and instead use the Perlin Noise algorithm, which is much easier on the CPU. Then in the Playground Manager > Advanced > Multithreading section set Particle Thread Method: One For All and Turbulence Thread Method: Inside Particle Calculation. For testing purposes you could also set Particle Thread Method to No Threads to see if everything runs better without multithreading.

    Sorry for not being able to help in more detail, but let me know how it goes and we could try figure out what could be the cause and possible workaround.
     
  19. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Sorry about that missing feature, it is coming as a parameter very soon!
    Till then you could make use of the scripted emission index, here's an example:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class EmitSize : MonoBehaviour {
    6.  
    7.     private PlaygroundParticlesC _particles;
    8.    
    9.     void Start ()
    10.     {
    11.         _particles = GetComponent<PlaygroundParticlesC>();
    12.         InvokeRepeating("Emit", .1f, .1f);
    13.     }
    14.  
    15.     void Emit ()
    16.     {
    17.         // Get the scripted emission index
    18.         int index = _particles.scriptedEmissionIndex;
    19.        
    20.         // Use any of the Emit overloads (this one uses the scriptedEmission variables)
    21.         _particles.Emit();
    22.        
    23.         // Set the initial size of the particle at index
    24.         _particles.playgroundCache.initialSize[index] = Mathf.Abs (Mathf.Sin (Time.time));
    25.     }
    26. }
    27.  
     
    mcmorry likes this.
  20. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi,
    It sounds like you need to keep track of where particles are in world space. In PP there's Manipulators which can send events upon particle enter and exit, they also have a tracking functionality where you can get info about all the current contained particles within their space. This could work if there's not that many needed at the same time within the scene (they could jump around to point of interest for example). Their position is controlled by a Transform and can have a customisable spherical and box shape. You can also set which layer the particles should collide with, which could come in handy in this case as you may want hard objects such as walls to collide, but not soft flammable objects.

    Feel free to ask for more details of course!
     
  21. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    What mcmorry said. :) Happy to hear that!
     
    Tryz likes this.
  22. Partiest-Cat

    Partiest-Cat

    Joined:
    Jan 16, 2014
    Posts:
    8
    Thanks for the reply! We'll give that a try.

    We made the jump to PP and I've been digging in this weekend to try and re-create our progress and I'm running into some really strange hitching/hiccuping related to particle rotation and texture sheet animations..

    I made a video that shows a slowed down version of what I'm seeing:
    https://drive.google.com/file/d/0B8JMZKnYO6Nbajg4LXdmdlZPTjA/view?usp=sharing

    Even without rotation added, the texture doesn't seem to be cleanly playing over time. When I add any rotation, it seems to hiccup and rotate sharply without actually rotating the particle over lifetime like I expected it would. Am I just missing something, maybe?

    Any thoughts on what would be causing this? If it helps, I did sync the particles to Main-Thread and haven't seen any result.


    Edit: I think we managed to get this ironed out. Was a problem with rebirth settings, perhaps.
     
    Last edited: Apr 11, 2016
  23. netics

    netics

    Joined:
    Aug 23, 2011
    Posts:
    102
    Question. How could I flip the effect? (billboard flip)

    In my project, many effects are just one particle with one texture.
    Not all effect textures are symmetric.
    So there is necessity to flip the effect.
    How could I do?
     
  24. chrissanders

    chrissanders

    Joined:
    May 24, 2013
    Posts:
    106
    I have a question I'm making a complicated effect. it has 3 different effects and it looks good. however right now one particle effects is kind of over shadowing the rest, and i would like to control the order of which effect renders. right now i cant see one effect because of the others. is their a way to decided which particle effects renders first.

    do you see the white effect in the projectile. i would like to do the same thing.
    http://i524.photobucket.com/albums/cc324/wind27382/new-to-street-fighter-play-ryu_zpsfrb0zztr.jpg
     
  25. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    @save Any eta for the new version of trails?
     
  26. netics

    netics

    Joined:
    Aug 23, 2011
    Posts:
    102
    Is there a way to scale entire effect?

    Transform.scale has no effect.
    It seems that there is no scale-relative parameter in inspector.
    I also searched API, but nothing found.

    No way?
     
  27. mrwogs

    mrwogs

    Joined:
    Aug 20, 2014
    Posts:
    36
    Hi PP users. I'm hoping one of you, or @save might be able to assist with a snapshot question I have.

    I have an emitter with two snapshots created. I would like to edit the values of these already-created snapshots. Is there a way to update the emitter's settings and save them to the snapshots? I can't figure out how to do this, so what I've been doing is deleting the snapshots, making the emitter setting changes, and then re-saving them as new snapshots.

    I'm hoping there is an easier and faster way to do this.

    Thanks!
     
  28. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    It's a good question, I'm not sure exactly if there's an easy way to horizontally or vertically flip a particle. The easiest way about it would probably be to have two rows on the texture which you would select a random of through the Texture Sheet Animation.
     
  29. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    You can determine which order a particle renders through the (particle system) Rendering > Sorting > Sorting Layer and Order In Layer. To edit the layers available go to (Unity menu) Edit > Project Settings > Tags and Layers > Sorting Layers.
     
    chrissanders likes this.
  30. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    It's difficult to say at the moment due to an addition in the family and a lot of everyday work. I'm hoping it's rather soon as I know plenty awaits improvements, but in all honesty all work and support lags behind to a certain point of frustration at the moment. I've been doing some R&D for the trails which seems promising but I'm also investigating possibilities to bring GC allocations down to 0 during all particle + trail simulation, which seems doable the more I learn. I hope to have a nice announcement quite soon regarding performance, focus is on fixing/improving current features rather than implementing more at least. I'll let you know (sorry for the wait)!
     
    recon0303, mcmorry and hopeful like this.
  31. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Way! Attach the ParticleSystemScaler component to a particle system and adjust the scale factor. To see it without pressing Play you can uncomment the [ExecuteInEditMode()] in the script.
     
  32. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hello! You can toggle the Advanced button in the Snapshots tab, then all snapshots created will be listed under the particle system Game Object in Hierarchy. You won't be able to see the effect while editing a snapshot though. Most of times it can be easier to load the snapshot into the live particle system to then tweak and re-save it.
     
  33. chrissanders

    chrissanders

    Joined:
    May 24, 2013
    Posts:
    106
    good to know i'll try again tonight
     
  34. FG_dev1

    FG_dev1

    Joined:
    Nov 3, 2014
    Posts:
    44
    Hi, I'm wondering how to have particles adjust to slowmo in game.

    Currently I'm just setting the timescale (I'm using Chronos if anyone is familiar with PP and that)

    Code (CSharp):
    1. particles.particleTimescale = clock.timeScale;
    But this doesn't seem to work well on some PP systems. I have a few specific questions.

    • Would this be the correct way of having the systems slowdown
    • Should the timescale be set for every system or just the parent particle system?
    • How can I apply this to the new trails for PP?

    Any help would be appreciated.
     
    Arkade likes this.
  35. frontakk

    frontakk

    Joined:
    Jan 8, 2011
    Posts:
    292
    Hi,
    I have published to create a preset particleplayground, it was imported into another project .
    I found this error...
    It can be found in the Unity5.3.2 and Unity5.0.1 shot_160427_124729.png
     
  36. chrissanders

    chrissanders

    Joined:
    May 24, 2013
    Posts:
    106
    hi I have a very basic question. i created a pretty good effect and I'm using a spritesheet. right now it plays each frame but they all pause for about .03 seconds which really hurts the effects. is their a way to speed the spritesheet animation up to know pause, to where it will play each frame quickly.
     
  37. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Hi,
    Been using PP successfully for a while -- thanks.
    Just run into my first oddity that's a bit of a corner case. I'm still investigating but hoped asking with what I've worked-out so far would be ok.

    What's different about using Emit() (the all-args version) to a generic Transform-centered emission?

    I'm using the "Advanced Normal Mapped Shader" (forum thread) asset with PP and it works fine when Transform-based but, on switching to script-based, it no longer normal-maps nor appears affected by lights. E.g. (1) Transform-based, (2) script-based.
    transform-based.png

    script-based.png

    (differing size is part of why I'm calling Emit() -- I wish my widely spread to be a single PP system and that works fine without ANMS.)

    I'll ask on the ANMS forum thread as well in case.

    Thanks for any thoughts so far!

    EDIT: Added links to ANMS.
     
  38. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Self-solved and yep, it's a bit of a "doh!" one, as always.
    "giveColor" was white and I'd left "Color Source" as "Source"! I changed the "Color Source" field 2 above to "COLORSOURCEC.LifetimeColor" and bingo! It's perfect. Sorry to bother!

    Thanks, Rupert.
     

    Attached Files:

    hopeful likes this.
  39. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    OK, I have another oddity -- potentially a bug. (hopefully not another "doh!" ;-) )

    Using a PP timeScale lower than 1 with this Emit()...

    Emit() (int quantity, Vector3 randomPositionMin, Vector3 randomPositionMax, Vector3 randomVelocityMin, Vector3 randomVelocityMax, Color32 giveColor)

    ... in a loop only seems to emit the first time called ?!

    Is setting the time scale the recommended way to slow down animation of one's texture sheet?
    Thanks, Rupert.
     
  40. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    375
    Hello.
    Congratulations for your assets, is really the best for particle systems in Unity.

    I have a question.
    I would like to play a sound every smoke "spry" of my smoke particle, in a loop system.
    Which variable I can use to determine when a loop cycle began?

    like:

    if (myPlayground.emitNow)
    sound.play ();

    How can do?
     
  41. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Hey @WILEz1975 I'm not the author but in case helpful (and until author or my betters reply), here's a quick suggestion.

    You might be able to do what you want with the Events system OnBirth event. Enable, subscribe in code and play sound when called. See the doc section about "Events in depth" (IIRC).

    HTH, Rupert.
     
  42. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    375
    Thanks for your answer.
    But with events can only interact with another playground system.
    I do not know where to call the play() function.
     
  43. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Sure you can. Read the doc section titled "DEEPER INTO EVENTS" -- there's sample code there. Change Debug.Log() to play sound!
     
  44. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    I'm looking to create this shield effect:

    Basically it's an outer glow around a sprite.

    I tried the 2DxFX asset from the store but the effect looks too solid throughout and distorts as you scale the size.
    I was able to produce a pretty good result using Photoshop outer glow to create a glowing version and put that sprite as a child to my main sprite, but the problem with this approach is that I need a glowing version for each sprite in my game.

    You can view the comparison between the two here: http://imgur.com/a/b4zi6

    I'm looking for a way to produce visuals similar to the Photoshop outer glow but without the drawback of needing two sprites for each ship in my game.

    Can Particle Playground help solve this, or do you know of an asset that might?
     
  45. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    I was able to create a shield effect, but my FPS drops to around 20 on a high end computer when there are a decent number of ships on screen:



    Any tips on how to optimize performance? I've already checked the 'sync to main thread' and made sure prewarm is on for all of them.
     
  46. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    I normally use shader's for these type of effects, even for mobile games, seems to perform well. I don't use PP for these type of effects, there many be a good way with PP that i'm not aware of but my suggestion is to make a shader for this effect, or use Shader Forge, which is great for these type of effects.
     
  47. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    With a shader, if you reduce the alpha (which I intend to do as the shield takes more damage), doesn't that reduce the alpha of the entire ship sprite as well?
     
  48. gevarre

    gevarre

    Joined:
    Jan 19, 2009
    Posts:
    132
    Hi Save,

    I'm creating a laser beam using overflow offset, like the one in the old examples preset. I'm then using a particle mask to adjust the "length" of the beam from script when it is interrupted with a collider.

    This is all working. However, at runtime, the Particle Mask enabled checkbox gets reset to off and Mask Sorting gets reset to Linear. Is this a bug? I've noticed in your script examples from a long time ago that you put this in the start function:
    Code (CSharp):
    1. particles.applyParticleMask = true;
    So it seems you're aware of it. This is fine, except how do I then also set Mask Sorting to Reverse? This doesn't work, but it was just a guess:
    Code (CSharp):
    1. particles.maskSorting = "Reversed";
    Shouldn't these settings really be saved at runtime, or is something overwriting them?


    Edit: Upon further experimentation, this is how I set Mask Sorting to Reverse in the start function:
    Code (CSharp):
    1. particles.particleMaskSorting = MASKSORTINGC.Reversed;
    I'm still thinking this is a bug though?

    Edit 2: Figured it out. I started with the laser preset in the old examples and tried to tweak the values, but it wouldn't save them for some reason. If I start out with a new, blank particle system and then set all the values the same as the laser, then it works fine.
     
    Last edited: May 23, 2016
  49. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    Hi!
    I'm looking into buying PP but there hasn't been many updates lately. Is it still supported by the developer?
     
  50. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    I think the next update is awaiting the official release of Unity 5.4, which was delayed a few months.
     
    zyzyx likes this.