Identifying object type in a line trace

You could add a Blueprint Interface and have all relevant objects implement it.

Declare your function (e.g. UseObject) in the Interface and define the behavior of said function in all classes implementing it. In your trace, you can call UseObject (message) on the HitActor (if valid) and the objects will take care of everything themselves. The trace doesn’t even have to know what type of object was hit, though I guess the Interface function could return the class type if you need it.

https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Types/Interface/index.html
https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Types/Interface/UsingInterfaces/index.html

That’s what I did in response to clicking on an object, which leads to different actions when executed on a NPC or an interaction object, and it works great. The only minor issue I had was that the interface function needs to have an output value (I used a “success” boolean) to appear in the list of implementable functions in the Blueprint implementing the interface.