Hey, everyone. I’m trying to do something I thought would be simple but it’s giving me a lot of pain. I just want to open a UI I made in the viewport when the player pushes “”. I followed this tutorial and did everything exactly the same except which button to push. I first did it using “=” like in the tutorial and it worked. I tried using the script in the player controller but it crashed the editor. I changed it back to being in the male & female character blueprints and the button pressed to “” and it still doesn’t work. I even tried changing it back to exactly the way I had it when it worked and it no longer works either. Pretty frustrated, this shouldn’t take this long to do and I’m completely lost. The UI is parented to PrimalUI which is the only other issue with UI crashes that I’ve heard of. This is the error I got the last time it crashed:
I you have any answers, please help me out and end my misery.
Also, is there a way to implement code for a button press anywhere else? I would rather implement it in the character parent blueprint but I can’t tell if that would work since everything I do crashes. Would it be possible to implement in the player controller blueprint? If there’s more than one possibility, what are the ups and downs of the choices?
I’d run a verify on your editor. There’s no reason for that error for a button press. I’ve got the same test - and I’ve placed it on just about every key imaginable, no crashing.
Are we talking about key input events? Cause they behave fishy sometimes. Sometimes it crashes if you wanna create one. Just try it again after restart. Also, keys that are used by the player key mapping will not work in blueprint. The input gets consumed in the c++ code. I would also recommend doing any input events in the player pawn or controller only. You can also do it in other places but for that you need to enable input first. As I said, input events are fishy in the ADK and unrealiable if the player has this key already bind to something. Rather work with interface buttons only.
I verified the editor from the Unreal Launcher. I’m not sure if there something corrupted or what. I went in and all the blueprint script I added is gone, so I made a child of the player controller and changed the gamemode to use it. I checked that I wasn’t setting the press event to a button that did other things so I chose Right Control to open the UI. When I tried to add “Set Show Mouse Cursor”, it crashed the editor again. Then when I opened it again, the editor gave me a lot of errors about not being able to find a bunch of structures and items. I went on and just added the script for creating and adding the UI to the viewport, but didn’t set show mouse cursor. I just wanted to see if the press event would open the UI first. I played in the test map and pressed right control which then froze the editor and crashed it, but right before the editor closed, I saw the UI in the viewport. This is the Error Message I got:
After what felt like banging my head on a wall, I got it to work. I think trying to do the same script from the tutorial in the controller doesn’t work. It would crash and I would have to verify the editor again to try another way. The tutorial works fine, I just didn’t know I had to verify the editor. Thanks CFrankie! That would explain why the editor had an error for files I never touched. I’m pretty new to UE4 and game/mod development so thank you for your patience!