I set a variable in begin play, but when I use it, it is NULL……
The type of this variable is a customized pawn. I store a ref of the pawn of the level in the game instance. In this actor, I want to use the pawn.
It’s OK If I use “Get Player Pawn” to set the Pawn variable.
I don’t know why
All I see here is you getting the value of PAWNMain from the game instance. Twice.
If you want to store the pawn ref in the game instance, you need to set it also
Ok, but is that game instance reference valid?
It’s quite a convoluted way of doing things
If you want a reference to the player in the GI, you can just set it on begin play in the GI
Except that doesn’t work - hold on - ok it’s just not ready, this works
or
2 Likes