How can i cast line trace actor to static mesh object

i need a static mesh by line trace.But the hit result is actor or component,it cant be used in set static can i get the static mesh object?


The correct code would look like


As you can see, we are using a cast on the Hit Component, in order to get a static mesh component( a static mesh actor has an SM component inside), and then we just set the static mesh using a mesh from the drop-down menu or variable.

Enjoy :slight_smile:

Maybe you misunderstood my idea,i want the hit result to be the new mesh, but i cant cast the component or actor to static mesh object

It can also be done this way