I am new to ue4 and i have problem that if i have item(key) in locker i cant pick it up because of collision box is to small and if i make it bigger i can pick it up even when locker door are closed. So want to make pick up system with line tracer but dont realy now how.
Not sure why nobody replied. Just place a LineTraceByChannel node after the interact key (which you should bind in the Input tab of your Project Setting) and make the start location the world lication of your camera. Multiply the forward vector by a float (500 or so) and add it to the camera location to find the end of the trace.
If it hits, then break the HitResult and cast the hit actor to your item class. The remaining logic should be the same as what you already have. However, there are several tutorials that cover this type of system.