UE4-26 Handling diffrent part of shield


Please help me to recognize different parts of texture with hitscan when all parts are irregular. Do you have any idea how to solve it?

I’d love to be corrected, but I don’t it’s possible in blueprint.

However… It is possible in Niagara. You can get the UV values from a hit and, in Niagara, you can get the RGB values from the UV.

You need to enable UV from hit result in the project settings:

image

and in Niagara you can use the ‘export particle data to blueprint’ module

Sorry I do no know Niagra system. Could you tell me what niagra system and emiter should I choose to get these parameters?

I used a blank template.

It’s a bit of a fiddle, but it totally works. I will get back later with the setup…

Ok it would be great.

I just had one go at this, it’s a bit of a mare. I have to re-group and start again… :wink:

Step by step.

Make an empty emitter and put two modules in the update section. Sample texture, and export particle data to blueprint.

It’s called ‘my sample texture’ because the first thing you have to do is hack the sample texture module to give you back the red channel from a texture. You do that like this:

Tell me if you get that far, and I’ll do the next bit…

I am not able to selec RedChannel. How can I enable it?

It doesn’t exist, we’re making it.

Just drag what you have onto the node, you get this

image

Then right click LOCAL and change the namespace to particles

image

You can also rename the pin

image

Be sure to save this as your own copy, don’t overwrite the module.

Ok, done

You get this error, which you can fix by making it a GPU emitter

image

Done

Put your texture in

done

So, you could have done all that in the emitter, but the next part has to be in the system. You can just right click on the emitter in the content browser and make a system.

Ok, done

We make a Vector 2D user variable called UV

and an object type variable called NiagaraCallback


I am not able to change user parameters to vector or object.

Done

1 Like

I just have to check, you have this set:

In the system, we can now choose the call back