Mouse orbit scritp request

Hi all!

I'm looking for a mouse orbit script that satisfy this request:

Playing with the standard mouse orbit I met the limit of the Y axis, when I'm on the top of the target the camera spin around, you can see what I mean in the shot below:

http://img263.imageshack.us/img263/8872/mouseorbit04.jpg

What I want is a different behavior, as show in the next screenshot:

alt text

How can I modify the mouse orbit script to achieve that?

Tnx a lot

You could try modifying the camera's local transform to balance out its regualr transform so that you still have regular control over it regardless of what degree it's turned to.

Marked up for diagrams.

There are 2 ways of working here.

1. Using the editor

Parent your camera to an empty gameobject in the middle of your planet, and rotate that gameobject's transform whenever you press the corresponding button. This way the camera will rotate along with your empty game object.

Say: when you press your UP arrow, you'll want to have the parent gameobject rotate over it's Y axis.


2. Scripting

Sadly I don't have any code so i'll give you an article on camera's. It's in XNA but the same logic applies here. http://www.toymaker.info/Games/XNA/html/xna_camera.html


  1. Curcomvents the problem and is pretty reliable, yet it's going to limit your capabilities with the camera.

  2. Fixes it. But might give you a small headache.