Download

Help on highlighting actor during 1st person player raytrace

Apologies if this has already been covered and I just haven’t come across it.

My problem is that I want to highlight / toggle a light on an actor when a raytrace from the player is intersecting it. Turning the light/highlight on when the player looks at it is easy, but when the player *stops *raytracing the object I can no longer cast to the object because the player’s raytrace isn’t intersecting it.

How have people solved item highlighting like this in a 1st person / non-UI setup? I know for UI you can use ‘OnBeginCursorOver’ / 'OnEndCursorOver, but I don’t think that works in gamespace? Do I need to store a variable for “LastValidTarget” and then once the player raytrace returns invalid call that to turn the light/highlight off?

Any help is greatly appreciated. Thanks in advance.

Hi man ,
When you raycast to a light, and is a success, , you can save the light-actor-reference,
just pin out the “out Hit” and break the result, Get the Actor you hit, and promote that to a variable, Call it “LastLight”
When the Raycast will fail , you still will be able to use the reference, you saved to turn that off.

Thank you so much. I knew there was an elegant way to handle it, I’m just not familiar enough with the engine yet.

Cheers!