Currently I am at a loss on how to approach this, as I am still fairly new to UE4 blueprints. A while back I purchased a VFX pack that came with Physmats, decals, and bullet impact animations. After learning the engine better, I am now trying to put all of it together. So far I have found a way to spawn an emitter, but I am not sure how to get the correct emitter based off of the physcal material (or if that’s even the correct way to do it)
The only way I could think, is to compare the physmat the raytrace is returning, with each individual physical material. Then based off of what material it gets, spawn the decal and the particle emitter. I would imagine that would be super sloppy, and be a very, very massive blueprint tree. So for all you blueprint experts out there, what is the best way of going about doing this?
TLDR:
If I hit an object with a physmat of wood instead of metal, how do I get the wood emitter NOT the metal emitter?
The Hit Result returns the **Phys Mat ** (as you can see) then you can read the Surface Type variable from it and use a Switch node to spawn different emitters, sounds etc. based on the surface type.
Just drag the pin off the Phys Mat (from the hit result), search for Surface Type… then drag the pin off the Surface Type node and search for Switch (which will give you a switch by surface).
@TK-Master Very clear, the only issue is that you cannot add pins, so I’m at a loss on how it works with the Physmats. Would a string conversion and check work? (see below)
Hmm the only thing that I can think of is that you created the switch node before setting the surface types (in which case, right click and refresh the node).
But it doesn’t really matter that much anyway, since you got it working.