Couple Camera Questions

Hey guys,

I am fairly new still with blender and am going for a 3rd person style camera, so far I have a camera that is parented to an empty I have around my character which is good and what I am going for.

However I am having problems with setting up my camera pivot around the character.

I have it set to pivot around my mouse and I set my mouse in the center of the screen, so when I click and hold the left mouse, I can move my camera up, down, and around my character. I also have cursor enabled in game because I use it to click functions on my interface in game. My problem is when I click and hold down left click to move my camera, the mouse gets moved to the center of the screen which isn’t bad but I keep seeing it flicker in the middle of the screen as i move the camera which is annoying and weird.
Also if I click to move my cam while my mouse is anywhere but the center it makes the camera spin like crazy until the mouse is set in the middle of the screen and it corrects itself, would that be a simple check to not move camera until the cursor is at the desired location?

Is there a way to make the mouse invisible while it’s clicked down to move the cam. And is there a way to move the mouse back to the location it was clicked at so I don’t have to keep moving it from the center of the screen back to where I need it.

Any info on if I am on the right track or if I should be doing something different, or if any problems would arise later on would be appreciated as I am currently just figuring things out by playing with stuff =P

Thanks so much!

If you are using the system cursor, just turn off the mouse when the camera is rotating. Use bge.render.showMouse(0), and then turn it back on when the mouse button is released with bge.render.showMouse(1).

You can save the position of the mouse before the script centers it, then restore it to that position when the mouse button is released. That is easy enough to do in Python by getting the mouse position from the Mouse Sensor and reseting it with bge.render.setMousePosition().

You are correct that you need to set up a check system to not start rotating until the mouse is centered. Use a boolean value that is initially False, then set it to True when the mouse is centered, then set it to False again when the mouse button is released.

Ok perfect!!! Exactly what I needed to know, I was hoping I wasn’t off track on that.

Thanks so much man! Rep+++!