How do i show the mouse cursor?

How do i show the mouse cursor? currently i have a player character pawn and there is no show cursor option in the blueprint file but there is one in the player controller? is there a way to enable this for a character pawn or integrate the two? Thanks.

Hey,

you posted this in the C++ section but mentioned Blueprints, so i don’t know what you want to use.

In your CharacterBP, you can just Right Click and search for “Get Player Controller” in the Context Menu.

You can cast the return value of this to your own custom Player Controller class if you have one. Then you just drag out the return value of the Get Player Controller or of the Cast node and search for the bool “Show Mouse Cursor”. Set it to true and you can see the Mouse Cursor. There are some more Bools and Functions to enable Click Events etc.

In c++ there are several ways to get the Player Controller.

One example would be this:

APlayerController* MyController = GetWorld()->GetFirstPlayerController();

	MyController->bShowMouseCursor = true;
	MyController->bEnableClickEvents = true;
	MyController->bEnableMouseOverEvents = true;

If you still have questions, feel free to ask me.

1 Like

Yes, that didn’t work like i said its not a player controller its a player character that’s why i was asking how to show a mouse cursor in player character.

Thats why i showed you how to access the PlayerController in your Character Class. The ShowMouse bool is only available over the PlayerController.

there is a easy solution for this but u will have to do this everytime u create a new map.
Open Level Blueprint:

By Blueprint > Level Blueprint Then …

Thats all

work fine! but if a change player controller default with my player controller in world settings this procedure don’t work, why?

1 Like