This is completely broken in 5.1 Please update (Solved)

Edit: tldr add super::init() as the TA pointed out.

Long version that requires reading all posts. Okay soooo, after many many attempts at trial and error. I took a few steps back and really thought this out. My issue was impatience. I figured might as well try to follow through and after following the steps through to creating the menu class itself in cpp and repointing the parent, it started showing up. Soooo the big take away for any one who is struggling to get this to work at this point. Just follow through a few more lectures and it will come up. I think the missing component for me was the input mode(lecture 3 in next section). My best explaination is that without the finput mode the engine was not making the menu visible. Basically the game instance was calling the menu correctly but since there was no binding to the player controller itself it just didnt display.

For what ever reason I cannot get the ui to display via c++. The unreal documentation has a completely different way of doing this and I think that this course should be redone with the 5.1. I am not sure what I am doing wrong as I have tried everything I can think of. Even moving the relevant code into the player controller. I get all the logs and warning and on screen messages but nothing is showing on the viewport once I call it. I am not sure how else to go through this course without this crucial bit. So please update.

1 Like

You might want to give more context about the code you wrote and the exact errors you get.
Getting any UI to display in C++ for 5.1 works just fine, but like I said; there is not much to go off with here.

Hey there there is no compilation errors or any errors within unreal. The menu just isnt showing up no matter the way I call it. I even started over with the project from git and tried following. Basically what the problem is that the menu almost seems to invisible and not showing up regardless if done through exec or called in blue prints. Everything other part works fine. I just can’t see my menu showing up. So I must be missing something as I can’t see any discrepencies in the code as its litterally coppied from git.

Did you upgrade from 5.0 to 5.1? There is an issue with that process. One thing that does seem to be missing is the GameInstance Init call does not call Super::Init() and it seems that adding that in helped.

if that fails, a new project in 5.1 may be necessary. Note the course does work fine in 5.1 but upgrading from earlier versions does cause issues. There’s no real engine-specific issues That aren’t encountered already in 4.27

2 Likes

Well, we still don’t have much to go on from. We need the relevant code. I realize you copied the code from their Git, but even then; most of the time something is still missing and thus the code, Blueprint or not, is not really identical.

It is or rather there is an issue with 5.1 upgrading for older versions which prevents the menus from working. Mark’s issue is a legitimate one.

Perhaps there is, perhaps there is not. It is, currently, not known whether he updated an older project or not. For now we only know it is not working, without any code or context whatsoever.

I’m taking a leap here because it’s not the first time I’ve seen it and have successfully recreated the issue Mark is experiencing about a day after 5.1 was released. Working directly in 5.1 is fine, upgrading to 5.0 is also fine. Upgrading from 4.x or 5.0 to 5.1 causes exactly this issue. I’ve also experienced upgrade issues with other courses/projects as well so not just this one…

I’m looking for confirmation only.

Gotcha. And yes, upgrading is causing me headaches here and there also in more than just UI :smiley:

Thank you for explaining. I did do a fresh project from scratch the first time, second time I used their git and upgraded, and now I am on a third go around where the menu isnt displaying in 5.1. I think I have narrowed it down to the finders. When I try to play using stand alone i get the below error and my .cpp file follows. For my third time around I just went straight to on screen messages to save some time. I rebuilt, I deleted binaries and rebuilt and I also tried a rebuild from visual studio code. When ever I comment out all the stuff relevant to the helpers the standalone works. The weird part is when I play in editor the on screen message from the class finder works. So something very strange is going on and I can’t put my finger on it. I will try using the super init, but that shouldnt matter as all i am doing is displaying a couple of messages.

LoginId:04765cc04c8ca6fc94c4dca7d49013d3
EpicAccountId:a376e71e899e4dd99c4afae95548ae12

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000eb8

UnrealEditor_Engine
UnrealEditor_GDTV_PuzzlePlatforms_0001!UPuzzlePlatformGameInstance::UPuzzlePlatformGameInstance() [D:\Game Dev\Projects\GDTV_PuzzlePlatforms\Source\GDTV_PuzzlePlatforms\PuzzlePlatformGameInstance.cpp:13]
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_CoreUObject
UnrealEditor_Core
UnrealEditor_Core
UnrealEditor_Projects
UnrealEditor_Projects
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
kernel32
ntdll

// Fill out your copyright notice in the Description page of Project Settings.

#include “PuzzlePlatformGameInstance.h”

#include “Engine/Engine.h”

#include “UObject/ConstructorHelpers.h”

#include “Blueprint/UserWidget.h”

#include “PlatformTrigger.h”

UPuzzlePlatformGameInstance::UPuzzlePlatformGameInstance(const FObjectInitializer &ObjectInitializer)

{

GEngine->AddOnScreenDebugMessage(-1,3,FColor::Emerald,FString(TEXT("This is from the base constructor")));

ConstructorHelpers::FClassFinder<UUserWidget> MenuBPClass(TEXT("/Game/MenuSystem/WBP_MainMenu"));

MenuClass = MenuBPClass.Class;

}

void UPuzzlePlatformGameInstance::Init()

{

GEngine->AddOnScreenDebugMessage(-1,3,FColor::Emerald,FString(TEXT("This is from the init constructor")));

GEngine->AddOnScreenDebugMessage(-1,3,FColor::Magenta, FString::Printf(TEXT("Found class %s"), *MenuClass->GetName()));

}

void UPuzzlePlatformGameInstance::LoadMenu()

{

UUserWidget* Menu = CreateWidget<UUserWidget>(this, MenuClass);

Menu->AddToViewport();

}

void UPuzzlePlatformGameInstance::Host()

{

GEngine->AddOnScreenDebugMessage(-1,3,FColor::Magenta,FString(TEXT("Hosting Server")));

UWorld* World = GetWorld();

World->ServerTravel("/Game/ThirdPerson/Maps/ThirdPersonMap?listen");

}

void UPuzzlePlatformGameInstance::Join(const FString& Address)

{

GEngine->AddOnScreenDebugMessage(-1,3,FColor::Magenta, FString::Printf(TEXT("Joining server%s"), *Address));

APlayerController* PlayerController = GetFirstLocalPlayerController();

PlayerController->ClientTravel(*Address,ETravelType::TRAVEL_Absolute);

}

I am just going to try handling it from the player controller since that’s where this should be happening in the first place. I can handle all the logic on the game instance and then just use the player controller to construct and add to view port. I removed all my game engine calls just to be safe and it didn’t do anything different. Will post update once I figure this out.

I kept thinking that I had a fresh install directly to 5.1, but I am not so sure. I haven’t tried going to the part where the interaction is enabled, so I will try adding those bits and seeing if it’s something weird to where the interaction makes it actually show up. If all else fails I have two options, install the version that this was made on or just go through the motions and still learn how it should be done. I could do a completely fresh install of 5.1 but I don’t know if I want to do that.

I do know this works. I threw together a prototype that was basically a stripped back project just showing a basic widget and it worked fine. I never found a reason for it other than the upgrade of a project. I was even able to get the menu to show via blueprint but it didn’t work correctly.

The student in question just created a new project in 5.1 and added their code in, bit by bit, and it worked.

Yes I updated the post, a fresh 5.1 install did not work, it was a matter of just going through the entire lecture and skipping ahead to creating the c++ menu class. I don’t know which step specifically was able to fix my issue since I did both before testing. How ever I am able to get it working now along with going back and following the other steps to create and make the menu my own. Thank you all for the feed back as it really helped me have a good think about the issue and figured it was mostly likely just not being brought into focus. So yes this works in 5.1 and if I were just more patient I I would have been able to figure it out way sooner.

1 Like

I’m glad it is resolved.

Can you better explain what you did to get the UI to show up? I am in 5.1 and also have the issue of it not showing up at all no matter what I do.

I had to follow a few courses down. When Sam does the player controller bit 2-3 lectures down it all comes together.

I will add that for some reason my in game menu buttons didn’t work at the end for some reason. So it’s good to go through the motions on all the lectures, but the next section I found it easier to start with the provided project files and upgraded to 5.1. The real difference between these two projects is the sub folders and how the character movement is handled. I haven’t gotten to the leash carts yet but so far it’s all been helpful information. Keep going and just follow the steps. By the end of section two it will all make sense and coke together.

I just did the first lecture about the player controller number 30. its still not working for me atm. Does it take longer?

For me it was when they went through adding to viewport and setting the focus to the menu. I basically had to get to the 3rd to last lecture before it showed up. The problem is that the menu needs to be brought into focus. For me it was getting added to view port but not visible. Even if I tried doing it through blueprint it didn’t show up. I don’t know if I can explain it better than for me it was just a matter of going a few more lectures in. You will see my post on the lesson that I figured it out and saying if I had just been more patient it worked.

Privacy & Terms