Issue with Multiple Blueprint Instances

Hello,

I’m currently having a rather strange issue. Basically, I want to be able to identify the material of a blueprint that the mouse is hovering over the static mesh element of and output it to a text render component of the same blueprint. I have this almost working, but with a strange caveat.

Basically, it only works when I have two instances of the blueprint actor, and the material element it displays over the wrong blueprint actor instance - i.e. if I hover my mouse over the mesh of one of the blueprint actors, it displays the appropriate material information in the text render of the other blueprint actor. as you can see in the image, I have cast to the static mesh compoent, while I’ve also tried having a reference to the static mesh component too - both giving the same weird result.

Your problem is not in the screenshot. It must have something to do with the way you linetrace or cast. Can you show the rest?

Does this very crude example demonstrate what you’re trying to achieve?

Image from Gyazo

You are a Wizard my friend! Always learn about new nodes when you reply to a question. Works like a charm.
Someone give this guy a medal!

Get Hit Under Cursor is nifty, yeah. Not sure what OP really wants to do with this, but this could be done better:

If you do not need Hit Results, the above will work fine once you enable Mouse Over Events {T} in the player controller. No need to trace, or tick. Just a single fire & forget event.

I don’t have the actual PC blueprint but this work for me. Is that how you do it or is there “less crude” way? :slight_smile:

Pretty much. It’s all nice and dandy until you read the tooltip of the GetDisplayName. xD

I see what you mean, we have been tricked again! :slight_smile:
@Everynone How about using Get Object Name instead? That should produce valid result every time, right?

You can do many things.

But in the end, if you want something shipment ready, you either create a DataTable with structs describing the objects or, if the scope is small, a dictionary variable might be enough - you associate materials (or whatever else you need) with text. Otherwise it’s impossible to maintain things and localise:

Here’s the doc:

It’s super useful for many, many things.