I’m trying to make a script so i can drag with my mouse and the camera rotates around my character.
what i have so far is :
var delta : Vector2;
function OnGUI() {
var e : Event = Event.current;
if (e.isMouse) {
Debug.Log(e.delta);
}
}
which gives me the amount i drag my mouse on the screen in Vector2
now i want to use this value on the Vector3 of my camera position.
I don’t know how to do this.
Any suggestions ?
Thanks.
Why not just use the MouseLook or MouseOrbit scripts from the standard assets? If they don’t give you the behaviour you want, you may be able to tweak them or at least use them as a guide to implementing your own script.