I have a kicking door animation but when you activate the animation and stand too close to the door the leg can be seen through the door window on the other side of the door. Is there a way to make the parts that are going through a mesh invisible?
I think you really, REALLY need the leg to be invisible at points where it’s behind the door, you could try to make the material of the mesh have a visibility mask, that somehow is calculated to be of the parts of the mesh where it’s behind the door or something like that.
That would take a lot of time to implement correctly and probably would not be the most performant thing ever. So as @CorsairOfLight said, just try to adjust the animation and the mash positioning a way that the leg can’t be seen through the door window.
Well the current system is a overlap box and when you are in the box you get a menu which let you choose how you want to open the door. So when you are at beginning of the box then it looks fine. The leg touches the door and the door moves with it. But when you stand right at the door you can see the leg through the window on the other side.
I don’t really want to make it so the player clips into position. But I guess if there’s no easy solution I’ll just let it be.
What you need to do is delay the animation of the character slightly.
Try making his kick happen after the door animation goes off. This will make a suitable gap in which he can retain his foot distance from the door when kicking it in. Play with the timing of the animation.
Detect if the kick will actually open a door before doing the kick, and if so, place the character in the position where the animation will not get into the door, doing a blend in the positions so it’s not too obvious
Hiding bones of the mesh and showing them again?
Placing a collider in the foot, and having a early reaction as soon as it hits? Like pushing the door or playing a “Kick canceled” animation?
I believe the method is to use foot “IK” which means the footbone is setup to detect hitting _x.
Heres a tut that I didnt finish. Or search for UE4 IK foot or hand.