I know this has been answered lot of times all over the internet.
But I still got to ask as I am not able to wrap my head around it about which is the better way.
I guess there is no one perfect way. It depends on our situation right?
So how do we actually decide depending on situation.
Let’s say I have a camera BP and I want it to adjust its position depending on the grid size from another Grid generating BP.
I can provide the values directly in camera BP. But my grid size might change depending on user input and I want camera location to adjust accordingly to fit the grid in the screen only on “Event Begin Play”. So I need to reference variables from Grid BP to camera BP.
I have only two ideas as seen in above image. There might be many more out there, Then I wanna know please.
I cannot totally understand from above two. How to decide which to use?
Also I always struggle what object to put in into cast node. I mean I know it just checks the input object and if it is correct it gives output. But how some peoples uses it to reference variables and what they put into input object node?
Because casting fails if we don’t provide input object node to it.
In above answered link he suggested three ways. I didn’t understand the second one though!
Also documentation link from 2nd answer is dead. So can’t find good documentation just related to referencing variables.
Then
Here is another. See the 2nd last comment by making it public.
Can anybody explain is it different from the three method suggested in previous link?
How to do it? Because he say right click and variable will directly appear in other BP. Doesn’t seem to work.
Also I seen people using event dispatcher to communicate and its also on Unreal Engine youtube playlist.
But it seems inappropriate to create event dispatcher just to pass a variables. Or Not?
So which way to prefer depending on different situation?
Can Anybody list advantage and disadvantage of using one way over the other? Or
Is there some video tutorial / documentation link which will resolve all these confusions I am having?
Note that I am more interested in clearing these confusing than solving my Camera BP issue. I can solve that issue by “Get Actor of class” I am just interested in various ways of referencing variables.