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.
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?
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.
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.