Custom GameInstance Class cast failed when Runtime

Hi,

I called get GameInstance in PlayerControllerBP and cast it to my derived class myGameInstance, everything works fine in Editor.

But after I package it to runtime, I found the get GameInstance call in my PlayerControllerBP failed to cast to myGameInstance class and it is the original UE4 GameInstance class instead.

The timing to call is not a suspect for I get the GameInstance when I press a key, and the system is ready for a while.

Strange.

What do you mean by ‘package it to runtime’?

Do you mean play standalone, or a packaged build?

I try both choices, they act differently.

In playing standalone, the Cast works. In the packaged build, the Cast Failed. :frowning:

I don’t know if this is of any help:

Thank you. This is exactly the answer.
I spent a long time to understand the post. Now it is fixed.