A masked material still cast a shadow when opacity set to 0.

Hello everybody !

I have some skeletal mesh with masked material. My is that when the opacity mask is set to 0, the mesh still cast his shadow…

I know that I said elsewhere that I like this unwanted effect but I want to control what the player see when a unit is masked by myself.
The thing is I can’t get rid of these shadows…

I check the mat, the light, project settings… I try many things but I can’t get my shadow to use the opacity mask.
When searching the net, I found a lot of person with the opposite problem (they have no shadow at all) but nothing about this.
I try to deactivate the distance shadow…

does anyone know what’s wrong here ?

Is the opacity set to 0 by constant or is there some more complex math driving it?

The opacity is droved by some simple maths build around “absoluteWorldPosition” and “DistanceToNearestSurface”…
But when I just input a constant 0 to the opacity mask, the unwanted shadows disappears… So the problem is in deed here :

Sans-titre-1.jpg

I already try to tweak the absoluteWorldPosition node withe the different settings I can see but the shadows still here…

Maybe will I make something with a if node and give the mask a 1 or 0 constant value but it seams very strange to me that this isn’t working normaly…

EDIT : I did the test with the if node but the shadows remains when opacity mask is set to 0… It’s definitly the presence of the worldPosition and distance to nearest surface that cause the trouble but I don’t see a way to get rid of them and I want to understand the problem :slight_smile: