Home Unreal Engine

UE4 Interactivity question - Material callouts

Decency
polycounter lvl 10
Offline / Send Message
Decency polycounter lvl 10
Hi everyone,

I'm new to interactivity in UE4 so I'm unsure if this is a simple request or a complex one.  I have a scene set up that I can walk around in, and I'd like to add in the functionality below:

1.) A click or key command makes a popup appear on the screen as well as a crosshair in the center of my viewport.
2.) This popup shows the name of the material applied to the surface directly under my crosshair (wall, floor, object)
3.) If I move the crosshair around to a different surface, the callout name updates to show the material applied to the new surface.  Essentially it's   always "active".
4.) Pressing the key command or clicking again disables the crosshair and popup.

If anyone has any ideas on this or could point me to any useful tutorials I'd appreciate it.

Replies

  • rymbrant
    Options
    Offline / Send Message
    rymbrant polycounter lvl 4
    I think there is plenty of info out there about creating UMG interfaces so will skip that for now.  The material retrieving can be done using a line trace from the center of the camera.  The hit result will have the info you need to plug into another function called Get Material from Face Index.  Demonstrated in this vid:

    https://www.youtube.com/watch?v=SvsSnkwB1TQ

  • Decency
    Options
    Offline / Send Message
    Decency polycounter lvl 10
    Hey, thank you for this!  Wanted to let you know it worked out great.  He didn't really show the entire functionality in this video, instead just showed the little snippet about the raycasting.  But from a different tutorial I was able to piece together how to fire the rays from the camera itself, then how to load that information into a UI to do what I needed.  Thanks again!
Sign In or Register to comment.