I have a line trace that triggers an event if hitting a certain object. That is working fine. But I want it to only trigger the event if the character looks at that object for 2 seconds. If the character looks away, the trigger should cancel. I can’t seem to figure it out. Any ideas out there?
- Create a Blueprint class of the object that you want to look at for 2 seconds. I called mine ‘BOX_BP’.
- Inside your Player Blueprint class, create 2 float variables called “Delta Time” and “Look Timer” and follow the picture below. Hope this helps
View Image In Full-Size: &d=1483710891
(To get the Break Hit Result node, if you drag out from the Line Trace By Channel “Out Hit” pin and at the bottom you’ll see Break Hit Result, click that )