- Home /
Random 2d particles in Particle_system from spritesheet
Hi! Can't find a way. I have spritesheet of several feathers that i want to act as particles. I set particle system - then assign material which is a spritesheet already sliced in unity and set render - with alpha transparent. The thing is that the whole spritesheet is generated as particle but i want each particle to be randomly taken from the spritesheet so the feathers will be different(i have about 8 variants). Please help.
Answer by Louis-N-D · Sep 04, 2014 at 05:49 PM
It is possible, and I use the technique extensively.. Not only to produce variation but also to allow all particle emitters in my game to share a single material.
In the emitter's "Texture Sheet Animation" settings, assuming you have a sheet of 16 different feathers in a 4x4 grid, set things up this way:
Tiles X:4 Y:4 Animation: Whole Sheet Frame over time: (select "random between two constants") 0 to 15 Cycles: 1
Play around with these settings to see how you can use them to incorporate multiple particles onto one sheet. For animations or randomization as you're doing, I usually put all the frames on one row and set the Animation setting to Single Row instead of Whole Sheet. Anyway, experiment with that.
Thank you ! It's Alive! Alive! ^) Now theme can be closed ^)
Answer by LSPressWorks · Sep 04, 2014 at 03:21 PM
I'd split then up, create an array of a variable for the materials, and select a random array element to assign personally.this allow you to add, change pieces of art without re doing the sprite sheet. Otherwise there is a YouTube bid called like, unity advocate texture, that links to a script that can handle that via it's index variable. Being on phone i can't get to it though.
Your answer
Follow this Question
Related Questions
Scale down spritesheets without breaking anything else 0 Answers
How can I key out (remove) a color from a spritesheet (2D)? 1 Answer
Animating hair over sprite animation 0 Answers
Fast Sprites Extraction from Sprite Sheet 0 Answers
Can Normal maps be used to create a 2D sprites lighting system? 2 Answers