How to change actor material (or Mutiply material ) when I trace hit a actor

As you can see,I want to change item material when I target it

all my trace item is store in Actortraced variable,I set it as a actor

when the item is traced.the item store in Actortraced,and there is an interface that can do something witch name is touching

I heard when you want to change material,you have to use component,

I don’t really want to change my Actortraced variable to component variable ,

So what do I need to add?

you have different options depending on the result you want:

  • you can do it directly in your material, using vector math, there s a good exemple in the content examples (math hall if i remember well)
  • you can cast the traced object to it s class, and the get a reference to the mesh, and change it s material, (but that can be trick as you may have many different actors class)
  • you can add a simple outline using a post process and custom stencil pass (enablig custom depth on the actor you are curently looking at)