Hello. I’m trying to change object visibility between character and camera. For that I’m spawning line trace by channel from camera to character. When there is an actor between them I want to get it’s material and change the value of opacity in that material. But how to get that material? I don’t want to convert all meshes to blueprints like in that video: UE5 Tutorials : Control Material Parameters on the Blueprint - YouTube.
It works for me, so you should debug your code. Print components, check collisions, etc.
Seems like the problem is in “Get material from Collision Face Index” node. Is it require primitive like cube, cilynder, etc from shapes panel?
The target is a primitive component.
It requires any primitive: static mesh component, skeletal mesh, procedural mesh, etc.
Well, suppose, I don’t quite understand what is primitive component. Is my wall should be an Actor (Blueprint)?
Fixed that. The problem was in “Trace Complex” setting of line tracer. Needed to toggle it on. But now cast to material instance dynamic is always failed.
Have you set the dynamic material instance to your meshes? Do The Materials have an Opacity scalar parameter?
- I don’t know. I’m just created material instance and applied it to mesh.
- Yes
Oh, I thought I can do it without convertion to actor. Finally, it’s work. Thank you very much!
Thank you again. Works perfectly!