Hide Mouse while panning camera with mouse

Hey there, i have made an RTS like Camera Pawn. While im pressing the middle mouse button, the camera can rotate around the center as you would expect. The problem is that the mouse curser wanders around while doing that. When i simply use Set Show Mouse Curser (uncheck) in der Player Controller while pressing the middle mouse button, i cant rotate the camera anymore.

Does anyone now how i can keep my functionality of rotating while the mouse courser is hidden?

All my movement and rotation logic is inside the camera pawn. Do i have to put it in the player controller?

Thanks to anyone who can help me with that.

As a reference of how i want to do it is the game Kenshi.

This is the blueprint of my Camera rotation.

Here is the blueprint of the Controller.

are you calling the input action on two different actors?

if so, you should probably call it in one place, like the controller.

then pass the event to whoever needs it, like the player pawn/character. I dont think this has anything to do with cursor being visible. Did you confirm that cursor visibility to make a difference?

Thanks, i will try that.

Its most likely not the visibility but the input on two actors.

you can visualize it like this

Player Controller is persistent, so it’s good place to handle input

Player pawn/character may be variable, meaning it might change, so each pawn/character can interpret the input events in their own way.

Usually a springarm+camera setup is attached to the pawns - I guess there is more advanced setups where you have a camera manager class but if you don’t need extra layer of separation, might as well keep it simple and just have the character/pawn tell their springarm+camera components what to do.

Anyway, always good to try and get your desired functionality working with as few moving pieces as possible first, then you can separate and add complexity one step at a time from there. overall you have less headaches that way.

Thanks for the answer.

How do i pass the input event to my pawn in a good way?

So far all the behavior is inside the pawn BP like in my first screenshot.

On the controller:


it is better to not cast every time. You might store the actor as a reference on begin play, for example, or some more advanced setups might involve using interfaces. But good to only add complexity when situation demands it.

On the player pawn:

That solved the problem and your answers gave me a great inside of the inner workings of the systems.

Thank you very much!

Here are my working BP’s

Controller:

Pawn: