@ClockworkOcean thank you for your replys. I make a functions where by pressing “X” some but not all objects turn to X-Ray material, let’s say like an X-Ray Glasses function. It is a transparent material with Fresnel on opacity. So, some objects become like holograms or under X-ray. Honestly there are a lot of objects which I have already placed in the scene so it would be difficult to reasamble them into a bluprint, that is why I try to retrieve them right from the scene.
About your StructA advice, do you mean I should create a structure to keep the materials? Well, I already tried it for components, and it works absolutely the same way as a variable. Frankly I am pretty new in UE5, so I never used structures before. However, it turns out that it looks almost the same like a variable for me, just in a separate file.