Cast to actor component

Hi All!

I stuck with a “cast to” object reference problem. Didn’t find an answer.

So I have a building (just a static mesh) and I’m attaching blueprint component to it. The component makes building to change materials when the mouse cursor is hovered over it. No problem here.

Then I’ve also decided to get tag information from the building (in the same component) and display it on the screen by using a widget.
So now I have the variable with tag information set on mouse hover.

Then I’ve created a widget blueprint and tried to cast to actor component and failed miserably. Have no idea what to put in “object”.

What am I missing? Is my approach correct?

Do you need to get the mesh reference from the current actor?

Then it would ‘current actor’ → cast to ‘material and kks’ → get static mesh

It’s a bit hard to tell without knowing where this code is situated.

Welcome to the Unreal Engine forums @Dimitrisv and happy holidays!

This topic has been moved from International to Programming & Scripting: Blueprint.

When posting, please review the categories to ensure your topic is posted in the most relevant space. This thread has been moved to help other devs with similar questions.

Happy developing :slight_smile: