Hi Guys, I hope this isn’t a repeated question.
I’ve been working on a 3D point and click game, like maniac mansion, and I traced the mouse position in my Controler BP, on mouse input. But i can’t seem to tranfer the hit actor value to any other BP. I’ve tried Dispatcher events, interface, casting to BP, setting variables, but nothing works. I always get empty variable value on the other BP.
I tried Tracing on different BPs and i still cant share the results.
In the end, i had to trace repeatedly on all/each my BPs, and it works, but i would like to know if there is a simpler way.
Try setting the trace data to a variable, then get those variables in the other blueprint. See if that works.
I think passing the HitActor by reference should do the trick.
Here is a link to another post that has a screenshot showing the reference-checkbox: Is it possible to pass blueprint variables as references? - Blueprint - Epic Developer Community Forums
Everything that is no value type (like int, float etc.) must have a copy constructor if you want to pass a copy. Otherwise it has to be passed as Reference.
FHitResult does not have a copy constructor: FHitResult | Unreal Engine Documentation
Actor doesn’t have one either.
But nevermind passing by reference is better performing anyway.
But take care, if changes are made to the object passed by reference, they are made everywhere the reference or object itself is used instantly.
Hi, thanks for the answer.
I have Tried setting to variable before, as suggested, but not passing as reference. Using an interface BP, i tried using with an input/output nod transfer, but EU4 doesnt accept, since the output in my HUD_BP has an empty entrace pin. Then i tried as a event and i get the same null value again.
So far, only tracing on the same BP has done the trick.
Thanks for the suggestion, as it’s going to be very usefull for some other ideas of mine.