Hi guys, anyone can help with a best way to achieve a camera rotation arround a sphere like the center of the sphere is the pivit point of rotation (rotation with left mouse button) and can zoom with scrool wheel? I normally just work with camera follow character or 3rd person but not with fix center point as rotation, ty
Check out the youtube channel called Renaissance Coders. The video name is "Unity3D Camera Controllers - Top Down Part 2".
Very cool, só if o understand i just hv to target sphere instead of player for camera Work orbitally arround the sphere right? Nice channel ty m8
I ask a wrong question here wt i want is to rotate the sphere in the 3 axes by a fix camera perspective something like in this video... Sry for my mystake, but the video u said is good too for other project.. Appreciate
After a quick analyze of the video it seems that i need 2 scripts, one in the camera to zoom in and out and another in the sphere to control the rotation.. Can anyone confirm me that plz? Im too newbie yet lol. Cuz the zoom part i can handle easly but the rotation part i only cant get it to rotate left and right and i need it to rotate all directions based on the center point of the sphere... My script right now that rotate only left and right Code (CSharp): using UnityEngine; using System.Collections; public class RotateOrbit : MonoBehaviour { public float speed = 10.0f; private Bounds bound; // Use this for initialization void Start () { var collider = gameObject.GetComponent<SphereCollider> (); if(collider == null) { collider = gameObject.AddComponent<SphereCollider>(); Debug.Log ("No collider is detected"); } bound = collider.bounds; Debug.Log ("Collider Size : " + bound.size.ToString ()); Debug.Log ("Collider Center: " + bound.center.ToString ()); } // Update is called once per frame void Update () { if (Input.GetMouseButtonDown (1)) { if (bound.size.magnitude > 0) { var dtx = Input.GetAxis ("Mouse X") * speed; var dty = Input.GetAxis ("Mouse Y") * speed; var pivot = bound.center; transform.RotateAround (pivot, Vector3.up, dtx); transform.RotateAround (pivot, Vector3.right, dty); } } } } Appreciate any kind of info, help...
Paykoman, did you manage to find a solution for this? working on a project that needs it and would highly appreciate it!