Download

how to get the actor‘s name or type which is hit by linetracebychannel?

I want to know weather the actor under my mouse is that I expected,So I ues linetracebychannel to find it,but I can not get more info about it。
how to get the actor‘s name 、 type or other info which is hit by linetracebychannel?

You can drag a wire from the Out Hit of the Line Trace by Channel node and select “Break Hit Result” and it will give you all the data from the hit result. You can get what type of actor you hit from the Hit Actor output.

^ Use the “Break Hit Result” Node and get the “Hit Actor” Reference. From there you can use “get Display Name” or “get Class” to check if the hit Actor is one of your types.

Or simply cast the HitActor to the Class you want to check it against.
Only Actors that either are exactly the Type of Class you cast against or inherit from it will
successfully finish the cast, others will fail.