Any mouse key + drag is pivoting camera but I didn't make any code to do so

Hi, I’m having a problem in that when I make mouse cursor appear while in game, any mouse button + drag is pivoting my camera around. But I didn’t write any code to do such.

Is there some setting I might have toggled? I looked through the player controller and disabling the different mouse options makes no difference.

I’m not sure where else to look.

Any help is appreciated.

image
So I made a fresh project with the default third person template. I set the space bar to show mouse cursor. After the mouse cursor is shown, then click and drag pivots the camera around.

So this is default behavior. The question is how to disable it.

Setting input mode to UI works but I still need to be able to click and interact with actors in the scene so that doesn’t work.

The weird thing is that this was working for another actor, I just ported the code from one to another. The new actor’s difference is that it is third person/first person whereas the original was only first person. I don’t think that should matter but something is different…

Well it looks like what I had done different on the previous character is that I checked for a flag before enabling mouse input. So basically when I do the event which makes the mouse cursor appear, I need to flag so that we can not run the mouse input events.

Seems kinda hacky and I can’t understand why this click+drag moves the screen is default behavior but at least I can move on…

1 Like

Glad you figured it out and thanks so much for updating the post for anyone else with a similar issue.

Good luck with your future projects! :slightly_smiling_face:

1 Like