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.
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 see what you mean, we have been tricked again! @Everynone How about using Get Object Name instead? That should produce valid result every time, right?
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: