How to get Static Mesh Reference from an Actor Object Reference?

Hey! As the title says, how can I get a static mesh reference from a variable type that is an Actor Object Reference?

Thank you, and sorry if this is such a noob question.

Get the actor reference, then get the static mesh component from the actor. Only works if the actor has a static mesh component.

Do you know what kind of Actor it is? Then you can Cast to that subclass, and get the static mesh component out of it.

If you don’t know what kind of Actor it is, you will need to use Get Components By Class:

image

Finally, if you’re doing this based on collision detection, you can get the list of overlapping components in the collision test, and look at which of those are static mesh (again, using casting.)

1 Like