i have a problem calling a custom Event from my MyCharacter Blueprint.
I have an InputAction called “MenuOpen” in the MyCharacter Blueprint. It calls the “Open Menu” Event from my GameHUD when a Button is pressed and the “Close Menu” Event when the Button is released. I have a Variable “Game Hud” which is my GameHUD Blueprint.This works fine in the MyCharacter Blueprint. But when i go into my GameHUD, those Events don’t get called.
Any suggestions on how this is getting fixed?
How are you calling these events? I know you said button press but like where is it called? And if you want you could just use “key “keyboardkey””
Like the node “key m”
as you see in the attached picture “mycharacter_blueprint.jpg” it is called via an input action, which is TAB in this case.
It is only possible to use keyboard keys in the MyCharacter Blueprint but not in the GameHUD Blueprint, thats why i call those Events.
ah via the input section of the event. totally forgot it. I tried that, but it didn’t work.
What i did was i added a boolean variable on the custom event “open menu” in my GameHUD Blueprint. I also added a boolean variable in mycharacter blueprint and connected it to the boolean input of the custom event call.
thx dude you are totally right, it wasn’t valid. but how can i access the blueprint when i don’t want to use the cast to nodes. is there a way to do make it valid?
Well I’m not entirely sure what gamehud is in your case.
Either the HUD class or a widget. If it’s the hud you can cast your HUD once to it on the event begin play and save it in that variable and it’ll work like a charm.
If it’s the widget just cast and save the reference when you spawned it (the result from the create widget node). That should do the trick for that case.