I am implementing a first-person/third-person C++ interaction system in Unreal Engine 5, but my Line Trace is failing to properly trigger the interaction prompt on a Blueprint Actor that implements my C++ interface. Please, help me. I truggle on this thing too long, and i have no idea for this
Everything looks good from what I can see at a glance. I would put break points at every step, so a break point at the InputAction firing and a breakpoint at the line trace. See if your input mapping is an issue or if when you line trace you aren’t hitting the expected actor or something.
It is also possible that your function performInteractionTrace is being called multiple times in short interval
so when the function is called first time it will assign the hit actor to currentfocused actor
but if the function gets called again in next frame, the condition if(CurrentFocusedActor != HitActor)will return false and the value of current focused actor will not be invalidated either, so you will never be able to get out of this scenario. Though this scenario only happens if the function is being called repeatedly
If you can share how this function is being called maybe it will be more helpful to debug
You can check what hit actor is. Maybe your trace collide another object and that object doesn’t implement interface.



