Global Game Instance BP does not recognize C++ event

Hello, I am experiencing an issue in creating a working camera based off of the Match3 Camera using engine version 4.21.2. I have a parent C++ called “MSGGameInstance” that has a BP called “MSGCamera” (based closely on the Match3 Camera).

MSGGameInstance header contains the script to set up the function and make it callable in Blueprint as an event. I also added #include “Engine/GameViewportClient.h” to get the engine to recognize the event.

MSGGameInstance ccp contains a call to the OnViewportResize function.

The only problem is that the Blueprint does not recognize the event when called and gives the error “Missing Event ‘OnViewportResize’ for Event OnViewportResize”.

What component is missing in order to get the blueprint to recognize the event?

Mr. Sasso,

Because I have access to the full code on this project, I was in a unique position to review the code and see if I could find a solution. I was able to resolve this. For those reading this solution, I am working on this project with Adam Sasso. The issue is now resolved.

The issue was that the code was missing both an “Init” function and a ViewportHandle in the MSGGameInstance Files.
See below images:

283209-gameinstanceh.png

Adding line 53 in the h file gave us the function we needed to call the viewport handle in.

After lines 34 and 36 were added to the created Init function in the cpp file, we were now successfully able to call the OnViewportResize event.

This functions as needed and is precisely what we wanted.

Cheers!

Adam W.

Thanks Adam! Your skill with programming is matched only by your staggering beauty!