Hey there everyone, I have a question for you folks. I’m sure it’s quite easy to figure out and all, but the answer is eluding me… How do I add this node (attached picture) to my blueprint? Like I said, I’m sure it’s simple, but I do appreciate any help. Thanks ahead of time. :eek:
Well, first you’ll need to have the variable that you want to set (Energy in the picture). Once you have created the variable, you can either right-click in the blueprint graph and search ‘Set Energy’, or you can drag the variable from the variables area onto the graph, and click set.
Set Nodes are added by either dragging the variable from the “My Blueprint” panel into the Graph Editor and selecting the Set option, or more pertaining to your case by your image that Set Node is attempting to Set a variable in another Object, hence the Target parameter.
To Set a variable on another Object, drag off of the Object in question and use the context search to find the variable you want to Set and then choose the Set option for that variable. To note, the variable must not be Private for it to be editable outside of its local scope.
You will notice that my Set Nodes i have create in that image are synced with the variables in the “My Blueprint” panel on the left.
It seems I should have elaborated a bit more on what I was looking for, I apologize for that. I’ve got a decent understanding of the basics in here so far, and I do have knowledge in programming (C++). What I’m trying to do is replicate what I have circled in the attached image. I understand how to add set nodes, but I’m unsure how to get the Set Node with the Target pin on it. Does that clarify it at all?
PS - That image is not mine, just trying to come up with an energy regeneration system and this seemed simple.
As i outlined above the Set Node with the Target parameter is used when your attempting to change the value of a variable on another Object.
If you look at my image above you can see my “Owning Player” variable, which is a reference to the owning player character which has a variable on it called “bHoldingInteract”.
You need to drag off of your Object Reference and then search for the variable you wish to set in the context menu.
So I re-attempted adding the Set Node using the method you described, after ensuring the variable was public, and it would not give me the node. It only brought up the standard set node. I have to be missing something, something simple… I do appreciate the help by the way
As long as your reference is the variable type of the specific blueprint that contains the variable, it should let you access the variables.
If your HUDReference variable isnt of the correct type, you may need to cast it to your custom HUD Blueprint type like @Jamendxman3 said.
Also just to clarify, your Energy variable you have there on the left in your “My Blueprint” panel is not the same as the variable Energy that you should have in your HUDReference Object.
If you look at my screenshot again, you can see that my Blueprint “BP_Base_Placeable_Structure” does not contain a variable called “bHoldingInteract”, im accessing that variable through the “OwningPlayer” Object which is where it resides.
I believe I understand what you guys are saying. I’m going to get back at it and see if I can fix it. I appreciate the help and will respond with what I figure out when I figure something out hehe. Thanks again!
So I figured out what the problem was regarding my energy regeneration section. I still couldn’t get the node I was originally looking for, but in the process found my error. Seems I forgot to connect the Timeline Node, now on to the next problem! Thanks again for your time and assistance.