Download

Show widget by line trace with pawn.

So I’ve been working on trying to get player names to show when one persons view hits the other player, I got the line trace to work properly and trigger when hitting another pawn with a specific tag. But for some reason when I try to use that to show a widget that is attached to the player, it wont work, Doesnt fail on casts just has zero output. But when I use a sphere collision it works. Any help would be amazing or even linking articles / videos that could help. Thank you!

Red circles show the nodes I connect to Cast to BP_TFPCharacter when I try using the line trace, the blue circle is the sphere collision overlap.
Both the hit actor from line trace and other actor from the sphere collision are the same type (actor reference) So im confused…

hi @Phonicz
On the branch after the raycast, can you access to the “Hit Actor” location or name?
check if the return value print a true.

Its strange that you can successfully check the actor tag but result empty for the cast.
by the way , are you casting to yourself? BP_TFPCharacter is the same actor-blueprint casting the trace??

Yep, I still can get the actor location and display name from hit actor after that branch. I watched a few tutorials and looked over some old posts and was told that the best way to get it to work for me was to Cast to the character and then cast to the widget inside the character, then show the widget so the player who initiated the line trace can see it. It works well with the sphere collision just not so well with line trace for some odd reason. I do realize now the casting to myself may be kinda pointless, but I was under the impression that I had to do that to be able to access the widget in the other character that the line trace hits.