My character automatically runs forward and I’m trying to SMOOTHLY rotate the camera to an object behind the character by holding down R and then have the character face an object in front of it by releasing R.
My code is below. Any help is appreciated.
using UnityEngine;
using System.Collections;
public class Rotation02 : MonoBehaviour {public Transform target; public Transform target2;
// Update is called once per frame
void Update () {
if (Input.GetKeyUp(KeyCode.R))
iTween.RotateTo(gameObject,iTween.Hash(target.position),"time",2.3f);
I get an error that says:
Assets/Standard Assets/Scripts/General Scripts/Rotation02.cs(11,32): error CS1501: No overload for method RotateTo' takes
4’ arguments