Gameinstance cast fails

Hey all,

Do I need to instantiate the game instance somewhere before I access it? I am getting a cast fail.

The below image is in the level blueprint event graph.

Within my gameinstance (called B_Gameinstance), there is nothing in the event graph, or construction script. I have a public variable setup in the game instance blueprint. I try to access the game instance by getting game instance, then casting to the game instance blueprint. That is the point at which it fails.

My first thought is that maybe I need to instantiate the game instance in a more root location like game mode or something like that, but there is no documentation to guide me on this.

15348-game+instance+fail.jpg

1 Like

I can’t look into the Editor right now, but i have in mind that you need to set the GameInstance Class inside the project settings at the button of the Modes tab.
Just like the Player Character etc.
If i’m right, have you done this?

6 Likes

Np, please mark the question as solved by clicking the “check” mark at the left side. (:

EDIT: I converted my comment to an answer. Now it should have the check mark.

That was it, eX1! Thank you very much. You made my day!

Haha ! Thanks a lot eXi ! This was my mistake too !

Thanks a bunch.

still cant cast event when added to the game mode settings

Thank You Very Much

This solved the issue I was having. Strangely, all of my settings changed to “none” when the editor crashed!

thanks dude

Thanks, It works!