Unable to change value of a variable from one blueprint in another

was that really so hard to say sorry if im frustrating you but it is hard to understand you

@connormurry

Have you gone through the Blueprint tutorial videos posted by Epic in youtube? If not, then please go through it. Also it looks like you don’t have much programming experience. Even though you can do blueprints without serious coding skills, you must have some basic understanding of how stuff work

This is the tutorial:

How ever you keep asking what REFERENCE is. I will try to explain it here:

When you are working with blueprints, a reference is not much different from a normal variable (Integer, Floats, Vector…). But when you switch over to a programming language like C++ they are entirely different. So if you are working with Blueprints only, you dont need to worry too much about it. In most cases, when we say ‘reference’ we only mean an instance of a Blueprint.

So in your case, you have a variable named ‘Character HUD’ of type ‘Character HUD_C’. Now this only means that the variable ‘Charcter HUD’ can store and instance of ‘Character HUD_C’ blueprint. It DOES NOT automatically create an instance and point to it. That is your job. Before you can use the variable ‘Character HUD’ and access any member variables, you first need to make an instance of ‘Character HUD_C’ and Assign (Set) it to ‘Character HUD’ variable. Until you do this, the variable ‘Character HUD_C’ is empty (aka Null/None), ie it is not usable. This is where IsValid comes into play. IsValid is used to make sure the variable you access is actually usable.

So in your case to solve the issue, this is what you will have to do:

If the default HUD class for your game mode is ‘Character HUD_C’, then you should get a reference to your HUD using ‘Get HUD’ node and assign the returned value to ‘Character HUD’ variable. Ideally this should happen within ‘Begin Play’ event.

On the other hand, you are manually instantiating ‘Character HUD_C’, you should do ti within ‘Begin Play’ and assign the created instance to the variable ‘Character HUD’

^ This is the right solution.

thank-you for finally explining this! Mind fane! But I have a question I don’t think I can assign a variable to the character HUD blueprint and I don’t understand why it took this long just to explain this to me.

If ‘Character HUD’ is your HUD class (which you have set in your Game mode), then you dont need to store it in a variable. You can access it anytime by doing ‘Get Player Controller->Get HUD’. Also if you want to store it to your variable, you first need to cast it to ‘Character HUD’ (ie the output of Get HUD is of type HUD,and you need to cast it to the proper class)

how would i set it as the HUD class?
i am using the widget blueprint for the HUD

Can someone just tell me how I would get a variable from another blueprint that’s not in the level, is not an object, and is used like with a widget blueprint where I can get its value and change it, trigger animations, and so fourth. I am starting to regret using unreal engine for my game because of the amount of difficulty I have had to go through just to try and get this solved and no one has a manged to help me solve this entirely. I thank you guys help! When I needed help you guys were there and prompted swiftly but I mean come on I have had this problem now for nearly 10 days and no one has managed to explain it properly to me

I am sorry that you are not able to figure out a solution.

From my experience, I can assure you that UE4 is the easiest engines out there. Blueprints are extremely easy as long as you understand the basic concepts. It is no different than a scripting language like javascript or unreal script. Thats why I said if you have programming experience, you will find it very easy.

While its true that Blueprints allow non-programmers to write game logic very quickly, you will still need to understand the basic concepts of programming such as variables, references, classes, members, inheritance… I don’t know how good your programming skills are. But I strongly recommend you to go through the youtube tutorials. If you are still having issues, the wikis and forums have plenty of tutorials on different subjects like networking, UMG, Animation…

Try going through them patiently and I am sure you will get the hang of it.

PS: Form what I’ve understood from your comments, I think you need to concentrate on Classes, inheritance and casting.

Good Luck

I mean I have a pretty expansive knowledge on proGramm ingredients I have dabbled in Java currently learning advanced c++ and I have played with lua. But I mean I have trouble figuring problems out with out explicit instructions I have a very hard time getting answers out of abstract answers

But I mean if you could please provide some tutorial videos I’ll gladly watch them ili just don’t know where to start

This is a good start: