Single Line Trace Interaction?

I created a Trace line and now i want to have Actor Objects that responds to the hit event. And also if the Trace hits an Actor that can response a widget on the players HUD should change.
I scrembled deep in the Wiki and almostm all Tutorials… Why is this so complicated?

Pls Halp :frowning:

You have to “cast to” your “hit actor” (from break hit output from linetrace “OutHit” output) to the type of blueprint you want. If this is the right type then you can drag from “cast to” return value (blue output) the function / custom event you want to activate in this blueprint, and you can change you widget as you need (in player with get player character / “cast to your character” and in game hud, “get player controller” / “get hud” / “cast to your hud”

If you have more than one type, you use the cast fail output to use a new “cast to”.

Line traces’ are not that complicated.

Will you be using this line trace to do damage as well or just to fire of functions for example.


Ninja’d by Fen again. LOL

Use ‘break hit result’ for your line trace. From that, get the hit actor. That’s the first part.
Then add a variable in your line trace blueprint and choose as type the blueprint of the actor that you want to hit. Name it somehow. Now you can access everything in the hit actor blueprint from your line trace blueprint. (blueprint communication)
Now check if line trace hit actor and hit actor are equal. If yes, then change whatever you want to change in your hit actor blueprint from your linetrace blueprint.

I work on this. But its hard… in this moment i try to cast to my character for a variable… it breaks everything. phew… tough.

Edit: Always do your work perfectly clean… dumb me. Works now after cleaning the nodes… Thx guys :3