iTween.LookTo C# (CSharp) Method

LookTo() public static method

Rotates a GameObject to look at a supplied Transform or Vector3 over time with FULL customization options.
public static LookTo ( GameObject target, Hashtable args ) : void
target GameObject
args Hashtable
return void
    public static void LookTo(GameObject target, Hashtable args)
    {
        //clean args:
        args = iTween.CleanArgs(args);

        //additional property to ensure ConflictCheck can work correctly since Transforms are refrences:
        if(args.Contains("looktarget")){
            if (args["looktarget"].GetType() == typeof(Transform)) {
                Transform transform = (Transform)args["looktarget"];
                args["position"]=new Vector3(transform.position.x,transform.position.y,transform.position.z);
                args["rotation"]=new Vector3(transform.eulerAngles.x,transform.eulerAngles.y,transform.eulerAngles.z);
            }
        }

        //establish iTween
        args["type"]="look";
        args["method"]="to";
        Launch(target,args);
    }

Same methods

iTween::LookTo ( GameObject target, Vector3 looktarget, float time ) : void
iTween