How to make emitters on NPCs visible with toggle

Hello!

I am working on a project where the player plays a wolf-dog character. I’m trying to set up the scent vision, and am having some trouble.

I’ve made the Niagara Emitter System, NS_Scent_Effect

It takes its color from the NPC’s Blueprint, so NPC_James’ NPC_Scent_Color

I’ve set up the enhanced input, and when I tested by having it fire print to confirm it took the V input it printed that it had.

What I’m trying to have happen:

when I/the player press V, the emitters become visible. When I/the player press V again, the emitters become invisible.

What’s the best way to do this? I’ve tested that the emitters work and take the NPCcolor (as can be seen with NPCs one, two, four, and five)

Thanks for the help!

Hi,

There is no a “best way” let’s say for now. You can do in couple of ways.

A simple way would be
Over here create a new variable as “Scent Alpha” a scalar.

Multiply your current scale color with “Scent Alpha” or create a new ScaleColor
image

And control Scent Alpha with that 0 hidden 1 visible. You can additionally lerp or timeline for smoother results.

Another simple way would be
Over your sprite, create a new material
image

Create a “Material Parameter Collection” and assign to materials opacity. Again simply control “MPC Material Parameter Collection”

If you have other use cases like, seeing scent behind walls etc there are some other methods like stencils or post process tricks.