Google Earth Mouse Control..

Hi…

Is there a way to make a sphere rotate dragging it with mouse (like google earth)?

Shouldn’t this be in Scripting section and not in the GUI section. Anyway, are you sure it is the sphere rotating and not the camera around it? :wink:

(yes, should be in scripting really…)

This shouldn’t be too hard to achieve; you just need to update the sphere’s rotation based on mouse movement when the sphere is being dragged.

Depending on your needs, you can detect ‘being dragged’ in at least a couple different ways: you could use the various OnMouse… functions in a script attached to the sphere; or you could use ray casts and Input.GetButton… methods.

There’s some code in this thread that implements drag rotation.

A simple search using the forum search function will bring up a couple of scripts that implement something quite close to what you are looking for. You may need to tweak a little but it’s covered on the forum more than once.

[Edit] andeeee was one minute and one link ahead of me. :slight_smile:

asdasdasd… thanks all… thanks andy for link… thanks DannyJ too… thanks…