Changable material Blueprint on crosshair over?

Hi guys, I’ve been using UE4 for archviz for about 2 weeks now, and so far ,im in love with it. But since i just started and still dont have good overview of how things should work i need you help. I would like to make a changeable material blueprint that should add to viewport widget with material options,and each of those options can be select if player crosshair hovers over it for coupe of seconds. To explain it a bit better, lets say i wanna change a material of the sofa, i placed i a rotating icon over it, that should signal to user that sofa material can be changed, and when crosshair is over it widget with material options will appear. PS. i have custom created crosshair widget isstead of regulal red crosshair and im working in FPS mode. :slight_smile:

Do a Line Trace starting at the camera location, straight out. If it hits something use the Hit Actor and cast it to the actor type you want to interface with, then you can tell it, you are looking at it.

You won’t see the trace unless you move your character, because the trace is heading straight out of the camera.

Why are you using the OnActorHit. Instead cast that HitActor to the type of actor you are using for the furniture, then fire a Custom Event on that reference.

Everything seems good, are you calling the ifLook event on tick?

Have you tried to debug step through this code while looking at one of the meshes? I’d put the breakpoint on the second Branch.

If that doesn’t help, my contact info is at the top, benvlodgi.github.io

Hi BenVlodgi,
I didnt call the ifLook, and im note sure where should i call it? In the target blueprint? Also im not sure how to call it, because if i use event thick and branch i need condition and if i plug ifLook after that, its needs target so i cannot compile blueprint. How should i do it right?

@BenVlodgi

Thanks for a reply but i guess this is over my current skill set. :confused: I tried adding line trace into my first person character blueprint but i cannot see trace appearing on the screen. Also im not sure not to call the object from another blueprint, or ignore all except the one i need?

@BenVlodgi Thanks again. Im really new at this and it takes some time getting used to it. Said that, i still cannot get line trace to work :confused: I flowed line trace tutorial i found online, and in stead of calling a widget i tried to destroy the object but line trace didn’t do anything. What im doing wrong?

First Person Character Blueprint

Blueprint Interface

Target Blueprint that should be destroyed / interacted with