Flip flopping a material back and forth..

Hey guys.

trying to find a decent way to hide anything that gets in the way of the player actor. so far ive just done a trace for anything between the player and the camera and set its material to a transparent one.

Problem is i cant seem to get it to go back to its default material as doing a “get material” on the hit result just gets the newly added transparent material.

any ideas on how to go about this?

example bp below.

Hello,
May be can you set “hidden in game” and save actor modified in an array of actors and when you need, loop the array and setting hidden back.