Changing Custom Stencil Value At Runtime Doesn't Work?

Is changing the stencil value of a static mesh component at runtime not supported? I am finding that if I change the value (say from 0 to 200) while viewing a post process effect that uses it, the object in question does not show up in the stencil mask. However if I START with that same value, then it is visible.

In addition, it seems that if I recompile the material while the game is running in PIE, the mask starts showing up as well. Is there something that needs to be done to force the object to update its render parameters if they change at runtime? Thanks!

I got this to work by adding MarkRenderStateDirty(). I am not sure if this is the proper way to handle it though, and would still like any feedback anyone can offer.

Thanks

It worked for me too. I still don’t know whether that’s the proper way to do it but it works ¯_(ツ)_/¯