[= ;281030]
Hi Acurapassion,
Breakpoints allow you to stop a blueprint at a specific node that you specify, much like breaks in C++ do for code. It is a way to visually debug your script to see what is occurring. However, the problems you are running into are potentially two fold. The first is that your mainmenu cast is casting to a NULL value, so you have nothing to cast to. This will cause it to instantly fail. You have to have a populated variable to cast to your MainMenu. Your EscapeMenu looks to be closer to correct, but depending on whether or not you have populated your EscapeMenu variable will determine if you are getting a NULL value or if it will work as intended. If you right click on the EscapeMenu variable and press Watch this Variable, you should be able to press PIE and see if the variable returns null or has a value. If it is NULL, you need to populate it before you can use it.
[/]
[=Zurael;281195]
Hey
What kind of class is MainMenu? I mean when you created it, what did you choose as it’s parent class, just actor? If it is an actor, how is it being created/spawned in your game? If your main menu isn’t doing anything other than creating/removing your mainmenuwidget when it is told to by those interface events, It may be much easier to just put those events in your playercontroller, or even gameinstance. (which is what I would do, but I use gameinstance for so many things)
If your mainmenu is just an actor, it may not even be created when you play the game, you would have to spawn it from somewhere, and then get a reference to it. You can get a reference to a playercontroller from inside a widget by using “get owning player”, or get a reference to the gameinstance by using “get game instance”.
[/]
So, I had a bit of a breakthrough last night with my casting. The only things I could really tell from using the breakpoints was that my variables had null values. So, I started looking around, wondering why this would be, and that possibly I was trying to cast the wrong value, so I tried several different things. And I came across a video talking about how certain things need to be put in a persistent game instance, so that they can be used at any point, like, before a level is loaded. So, I started examining my code, and it occurred to me (like I just realized Zurael already said) that the actor wasn’t actually in the game when I was trying to make the call, so I was essentially trying to cast to nothing. As soon as I converted the escape menu over to the GameInstance, instantly started working, and my Quit game button in that menu even works! Haha
However, I’ve tried a few different things, but I still can’t seem to change the fact that my play button still does nothing, or just doesn’t receive my clicks… I tried RemoveFromParent, as well as RemoveAllUI. And, I also can’t seem to get the hover to work, even on my working EscapeMenu.
So, one of my biggest problems is now solved, so thank you guys again very much!