In my characterBP I have a line trace (channel) -this works great and it outputs the actor it hits without problem. This is used for aim activation of objects.
I added the line trace in the character blueprint because that’s where it belongs in this case. The character is doing a scan. Now normally you’d simply just get the actor output from the line scan, cast it to the appropriate object and call a function.
For example:
Character walks in front of a door. The character line scan clips the door and outputs the actor (door). Then you’d cast that as a DoorBP and run the function connected to it called DoorOpenFunction.
The thing is that if you add the casting to the character blue print you’re going to have a lot of behavior not directly related to the character in there.
I’d like to do something like this:
Line trace → actor → get actor BP → check if function/event calls “BeingLookedAt” exists in the BP → run it (or something like that).
Then I don’t have to do couplings to specific blueprints inside characterBP where, in my head, they don’t belong. It’d also create a really large amount of castings really fast :S
Does it make sense? I’ve been banging my head against this problem for quite a while now :S