Why is my cursor not showing

Sorry, I haven’t. Looking at your links rn.

Yes I tried it, it still does not work. Here is the screenshot. Note: I added it to the execution line of the event that is called:

Am I using it correctly?

1 Like

The game mode that I am getting is the same in both levels. Could that be causing a problem?

I have implemented a game over system by making the game over screen its own level.

On the level’s begin play, I get the game mode and call an event (screenshot 1).

In this event, I set the show mouse cursor to true:

323863-event.png

Even after doing all this, the mouse cursor does not show when the level starts. What do I do?

Hi, Have you tried the SetInputModeGameAndUI node (Set Input Mode Game And UI | Unreal Engine Documentation) or SetInputModeUIOnly node (Set Input Mode UI Only | Unreal Engine Documentation) ?

You could try to provide a Widget to Focus in the SetInputModeUIOnly call. Another thing to test is to call SetInputModeUIOnly first, and then Set ‘ShowMouseCursor’ to true. Also when you create your widget (in the BeginPlay function), you should provide an owning player.

I tried putting the ‘set input mode game and ui’ before the set ‘ShowMouseCursor’. Still not luck. What do you mean by providing an owning player (sorry i am a bit new)

In your CreateWidget node there is an ‘Owning Player’ input, try providing your PlayerController(0) here. Then, save the widget’s reference into a variable. Variable that you will use for the ‘In Widget To Focus’ parameter of the SetInputModeUIOnly function.

Also, if you are testing your game in PIE mode (Play In Editor), you may try to launch your game in standalone mode instead.

What is that game mode? Is it the FirstPersonGameMode as intended?

You should try printing to the screen the value of ShowMouseCursor so that you know if it is “true” or if something else is setting it to “false”.

Yup I did that, and it is true but the mouse is not showing.

Yes. It is the FirstPersonGameMode as intended. Would that be causing a problem?

My best guess based on what I’ve read is that your logic is never firing. What is the result on your cast to this game mode? What is the game mode override blueprint? It’s possible your world override setting is incorrect. You would want to open the game over level and set the override to the game mode blueprint responsible for showing the cursor and widget.

Using a pure cast in this case, where you don’t know about which game mode to expect, isn’t serving you.
convert it to a regular cast and put a breakpoint on it. You have to be absolutely sure you’re going to get that class when using a pure cast, and even then there is a success boolean to run a branch if not. Once you set the override, you can be reasonably sure you’re going to get that game mode. Then you can make it a pure cast again… Just some debugging advice.

Again, my guess is that you don’t have the right game mode selected as override, based on your statement that they are the same mode in both levels. I don’t see why this wouldn’t work otherwise.

The death event, showing the widget and cursor, is on FirstPersonGameMode. That seems to be the blueprint you’d use for the playable part of the game, not the menu. It’s a bad name and could be confusing you. Rename it to MenuGameMode or DeathScreenGameMode or something more specific to help you out later. Then make sure that this game mode with the death screen logic is set as the world override on your menu level. Then, make sure your playable game mode is set on the playable level by either setting the override or setting this as the project game mode and having no override.

Happy developing,

Reishi