How could I spawn different emitters based on material?
Hey guys, I am creating a first person shooter and I was wondering if there would be a way to spawn different emitters depending on the objects that I shoot? I am using a simple line trace for my bullets and I have emitters set up correctly to spawn on location of hit, but as of now I can only assign 1 emitter to spawn. Any help would be appreciated! Thanks a lot!
This is something that exists pretty much exactly how you want it.
I'm assuming you have a medium amount of particle systems for different types of objects (aka wood, metal, stone).
In that case you can use a Physical Material!
A physical material contains a bit of information regarding some physics properties (friction, destruction threshold (if you use it on a destructible), etc.). You can add a physics material onto any material to give it those properties. If you give them a name for each type of surface you want (again wood, metal, stone, etc) you can then on hit check which physics material is applied to the material you shot and based on that spawn an emitter of the appropriate type.
It still needs a function like "GetEmitter" where you enter a physics material, then check which one it is and return an Emitter Class but at least it removes the effort it'd take to distinguish between all materials and reduces it to only make it necessary to distinguish between each type of surface you want.
answered Mar 07 '16 at 06:26 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here