How to generate hit result and use info to create widget on / off

Hi guys, I’m trying to use my Player controller on the event Tick to generate “Get Hit result under cursor for objects”. I managed to get it working with a custom collision set on specific mesh and even got it to print when I did that. that’s great! yeay for me…

ok so now I can get the name of the mesh every time my cursor goes over specific mesh I want to be able to generate a widget that pops up where the cursor is every time i overlap any object with the custom collison name. Now the way i thought I could do it was use a variable that is set by the “hit result hit actor” which would update the var on tick ( assume that’s how it would work?) I could then get an overlap with cursor or end overlap with cursor… Problem is, it’s not working! can someone tlel me why this isn’t working and what I would need to do to fix it?

Does it need to be a 3D widget in world space or can it be a regular widget like a menu?

Because the simplest answer is to make a widget that is anchored to the mouse and generates the widget bound to mouse position in the viewport for all objects that return a name. Though I imagine whatever game design you are going for you might want it to only do that for certain objects and the you would have to go into making it work for objects with specific tags etc.

Hi Vangald, it will be a widget on screen not world space, my initial problem I am having right now tho is I dont know how to get “cursoroverlap” to work for what ever is being targeted. I’ll give you an example… I have 10 blocks, a few of them are residential, some are office the rest are hotel. what I have done is create 3 bespoke collision names in project settings under collisions. I have assigned them to my blocks. I can defiantly get the hits I need as I have attached that straight into a log and it works great. my problem now is using that information to generate in a usable way to access the object. at the end of the day I want to display the static meshes name (we are working from REVIT and we are getting it to export the meshes by it’s area number, that way the user can just see the areas of each block just by hovering over it). I’m missing something? mmm

OK so this is what I have far, I can successfully create a widget from the custom collision, use the mesh’s name and get is displayed onto the text variable in the widget so the user can see it. what I need to do now is get the widget destroyed once the cursor is no longer on that object… any idea how I do that using either the widget or the player controller guys?

If this “OnBeginCursorOver” worked for this variable all my problems would be fixed! so wondering why I cant get it to work?!? I don’t want anything in a actor BP, in this exercise i’m trying to import data with the least amount of faffing…

This kind of works, it’s using the objects visibility, however this isn’t perfect since if cursor slides over to next object the visibility stays the same and the widget doesn’t refresh, i can’t think of a way to check if the object has changed :S

Ok I solved my problem in the end, I didn’t realise you can get a notification from the constantly changing variable by going into the variable and clicking “Rep Notify” under "replicaiton drop down. from there I created a remove widget once the variable changed name. i get a smooth result now, very happy!

Altho actually it’s not what i wanted after all… I thought it worked actually it’s always firing! all I want is an event to fire when a variable changes, surly there is something I can use? :S