I am looking into other methods that hard coding things in c++ and I started to work with blue prints. However I ran into some problems and need some help troubleshooting this. Currently I am building a test menu using the blue print system and and launch an event when a mesh is clicked on by the user and want to pass the bool var to the level blueprint to launch the event.
My question is how do I go about doing this?
I have been looking at some tutorials to try to find a decent methodology, but came up with some methods but nothing that really worked.
it depends which BP has the variable that you want to call. basically, the easiest ones to call are the ones that come from either the HUD or player/character.
in any case, you will need to CAST to the specific instance that will give you the value. that is to say, for example if you have more than one actor of the same class, when you cast, you have to tell unreal which instance of that actor you are casting to. if the variable is in the hud, player, character or pawn, is easier, as usually there is only one instance.
for example:
you have a variable in your player blueprint ( health )
to call it, you should have
get player controller> get player character> cast to and then > get .
unreal will help you when you are casting to, it will show the name of your player BP in that case.
please let me know if this does not make sense, i can SS for you if you need.