I’m new to blueprints and don’t understand how to make a variable global.
I tried to use blueprint interfaces, but quite don’t understand it.
What I’m trying to do:
→ A spawned object adds 1 to an integer variable, saves this variable for himself.
→ A new spawned object uses the new integer variable and also add 1 and saves this varaible for himself.
→ Now if the two actors hits each other I want to compare those two integers the one with the higher integer should be parented.
→ And so on.
I want to learn how to use Interfaces or how to pass a variable for this exact case.
If anyone could explain it step by step how to do this I would really appreciate it.
Just a thought, but why not have whatever spawns the object set the variable right after is spawns it. Whatever object does the spawning has the “global” count and assigns it to a individual object.
if the object has a variable you can click the eyeball next to variable in it’s blueprint. That makes it public. Then, after you spawn it you can drag out a reference to the public variable and call set on it.
I hope its not to much to ask, but could you show me an image of the nodes, I’m not really understanding how casting works.
I can’t seem to cast anything to my custom BPs.
EDIT:
Oh well … now I can pull casting out of the reference … nevermind.