Download

Using trace to overlap box component

I’m trying to figure out how I can use a trace to interact and control an actor, but only while the trace is overlapping it. Basically, I have my player camera shooting a trace, which can interact with one of 12 textured static meshes in front of me. While the trace is overlapping the mesh’s box component (i.e. while I’m looking at it), I want the mesh to come closer by a distance I specify (which I can increase and decrease with my middle mouse button). When I shift my gaze, I want the mesh to return back to its starting position and the next mesh I’m looking at to come out.

So far I’ve been using the PlayerController blueprint to set this up, but I suppose this might be accomplished with the level blueprint or the actor’s blueprint.

Anyone have any ideas how I might be able to accomplish this?