How do I have transparent mesh and retain shadows?

I’m new-ish to PB to please bear with me. This one is some what of a three-for-one but I believe its all related. Player enters a volume and the roof material is set to a transparent material (TM). I’ve got that down but I have not been able to fix these things:

  1. Material on mesh is changed to the TM for P1 when inside “InteriorVolume” volume and won’t stay opaque for P2 when outside of “InteriorVolume”. Have tried checking and unchecking the “replicated” box and issue prevails.
  2. Shadows also disappear with opacity(material) change. Shadows will stay on exterior ground if baked lighting however the contents of the room is illuminated since nothing appears to be blocking (or containing) the light at 100%. Lighting mode on material is Volumetric Directional. I tried messing around with that and nothing seemed to work :frowning:
  3. P1 or P2 shoots weapon when inside volume. Roof changes back to opaque until P1 re-enters volume. Is there an event tick that needs to happen to refresh this?

Example

WoodShack BP

Material

Any help is appreciated. Even partial help :slight_smile:

I don’t know if anything has changed on this front, but I cannot seem to find anything that will allow a translucent mesh to cast a full shadow. However, what I might suggest as a work around if possible. Overlay a secondary roof in the same spot, but hide that specific component in game and make it not visible, but tick the “Hidden Shadow” under the component’s Lightning properties. It should have the same effect that you’re looking for.

It worked! That solves the shadow issue. I was hoping the fix might be something a little more efficient than that but I suppose for now I can take it. Thank you! Did some more experimenting with replicating and I was able to get the roof to appear transparent for the players inside the volume(see below!). Still no luck with the roof reappearing though.

I do have my bullets setup as actor projectiles. My thinking is that they might be causing trouble by entering/exiting the volume. Could be totally wrong! :slight_smile:

I’m not sure if you fixed that last issue yet, but I got curious. I haven’t done anything with multiplayer yet, but I decided to set a third person starter up and ran two clients to play around with it.

This is messy, but this blueprint might help you. It just takes the collision box and checks for overlaps, and then checks that same collision box to see if it’s overlapping character index 0’s capsule(As far as I am aware, index 0 is always the client’s own character)

Then if that’s true it’ll set the material to steel. If not it’ll change it to gold. It checks this on both the end and begin.

In theory even if a bullet actor leaves the collision or enters, it should just check for the player’s mesh and set it accordingly. I think you could adapt this to what you need.

I will have to test this out once I get home today. Last night I did some more work with it and was having some crazy issues. I got an infinite loop error whenever I tried walking on the roof and once I managed to fix that the entire object became a trigger. Walking on the roof causes roof to become transparent even though the “InteriorVolume” is at floor level and .5m tall. I even removed the “InteriorVolume” at one point and the event was still triggered. Called it a night after that.

Will give an update after I try some more things :slight_smile:

Have not been able to get to this for a bit but here it is. So far, this is what I was able to actually get working. And it all works how I want it to (minus the shooting issue) but if P1 stands on the roof and P2 enters the building, P1 falls through the roof :confused:

Tried getting a cast to BP on to it to make sure it only happens to the one player but I couldn’t figure that out.

Just curious, are you setting collision off in the blueprints for the camera spring arm? If so, why not just make a custom collision in the roof itself instead of changing it in BPs and disable camera collision?

Nope! This BP is the wooden shack. Collision that is being removed here is the collision for both the shadow mesh and the visible mesh. Spring arm hasn’t been an issue in this case. I remove collision here because if I do not the character will aim up at the ceiling instead of looking around the room.

Forgot to come back to this! Solution found. It works however the physics replication is a little wonky. P2 can enter building and P1 be on top of building with no fall through. Other way around when P1 enters, P2 will fall through. When P1 exits volume, P2 teleports to original location. Im calling it a win though!