trigger animation when the camera looks at a point in the environment

Hi, I’m looking for some info on how to set up a trigger event when the camera looks at a point in the environment. This would trigger an animation to play.


You can setup a line trace for the camera and an “On Hover” trigger on the point of the environment, so that as soon as the camera points toward what you need, the “on hover” event will trigger the animation…

Thanks, Will look into that.


#1. Saw a thread in the Blueprint section recently with sample code if you browse through. What it did iirc, was execute a continuous camera center-screen trace looking for a desired tag in a target object. When it got a hit, it paused for a moment, then repeated the trace. If the same actor was hit, it assumed a ‘Hovered’ Event occurred and ran appropriate code.

#2. UDK had an easy way to do this… Just drop a Line-Of-Sight Trigger into the level. The UE4 equivalent is the WIC which takes more prep / setup, but it offers more, especially If you have lots of in-world objects. Add a Button to a Widget-Component inside a new Blueprint and place that into the World. Then add a Widget-Interaction-Component (WIC) to the Pawn that will Trigger the event, such as a character / vehicle etc. This will automatically generate On-Hovered / On-Unhovered events.