Why can't I see the cursor after the package?



why can’t I be seen?

try Construct instead of PreConstruct

It doesn’t work :C

Sometimes in packaged game order of executing things can change. Try adding a 0.2sec delay after BeginPlay, before CreatingWidget.

You don’t show what is this top blueprint, is it GameMode or PlayerController? If it’s a GameMode, maybe PlayerController is created sometime during that execution and it resets the InputMode.

2 Likes

whats calling BeginPlay? i assumed that was in the PlayerController itself? but in short make sure GetPlayerController is Valid.

load orders can be different between editor and package

I just tried it and it is valid

It finally works THANKS
ps: it worked thanks to the 0.2 second delay

keep in mind delays aren’t an optimal solution, its more for testing the problem. (ie what if in the future 0.2s isnt long enough)

a better idea is to move the logic from your widget to the controller and put it all in a function.

Great that it worked. And @Auran131 is right here that you shouldn’t relay on delay.

What is happening here, you create widget and set input mode on BeginPlay of GameMode. So for 1 tick PlayerController is not ready. When PlayerController spawn, it resets the input mode. In this single case delay should always work, even 1 tick delay instead of 0.2s.

Generally much better approach would be to move both snippets to PlayerController - spawning widget and setting input mode.

1 Like