|
It seems too be very popular to use particles with smoke and flame thrower effects. we are trying to run our game on ios (eventually) and that means its best avoid particles. I understand you can get away with small particles, but: A. this not the effect we want, particles have a fuzzy cotton candy look to it, we are doing a cartoon style 2d side scroller. Particles would clash with this style terribly. B. the game will have high physics demmands on it, so we are looking to chop out any cpu processors wherever we can. So we are looking for a script that can take an animated sprite,
I know this is a long list of needs, but suggestions on any of these behaviors would (few or many) will be appreciated. I am no stranger to javascript, so links to help me write a script on this are also welcome. Thanks for your help
(comments are locked)
|
|
I did a test of my own with a particle system I was able to achieve a decent flame thrower effect while only emitting 30 particles at any given time. It was pretty simple, by just adding a particle system component to my Gun Then using a Sprite sheet I found online as a texture. I messed with some of the emitter options and put in some very basic code to get it going. Below is a link to a video I recorded of the effect and some coding I used. link not working, can you share again? I want to do exactly what u describe.Thanks
Dec 05 '12 at 01:42 PM
Heav3n
(comments are locked)
|

What you are describing is still basically a system of particles. Particles are not necessarily fuzzy-looking; if you want you could use them to draw an animated sprite from a sprite sheet without any translucency, even using the default (and legacy) particle emitters/renderers and no scripts.
Personally I've found that on some mobile devices, dynamic geometry can be pretty slow in Unity (which makes dynamic batching and Unity's built-in particle renderers and most sprite frameworks too slow), at least as of Unity 3.5. And moving and rotating and (especially) scaling many separate game objects with meshes attached is even more expensive on mobile.
So far, the most efficient alternative I've found is actually to call Graphics.DrawMeshNow with a 4-vertex plane mesh once per particle (where each particle is simply a Vector3 and/or a matrix that I update in a loop) inside the OnRenderObject of a game object. It sounds like it should be slower, but it avoids a lot of the CPU overhead that's usually part of Unity's rendering pipeline, and it gives you full control over the particles. But it's kind of advanced stuff to get it right, and regular particle systems are fast enough for many situations even on mobile as long as you take care to minimize the particle count and overdraw (which btw should be done either way).
Right, particles only have a "fuzzy cotton candy look" if you make them that way.