am doing a small work in which am using lerp. The script is as below the error i get are
Assets/Scripts/camera.cs(33,68): error CS1502: The best overloaded method match for UnityEngine.Vector3.Lerp(UnityEngine.Vector3, UnityEngine.Vector3, float)' has some invalid arguments and Assets/Scripts/camera.cs(33,68): error CS1503: Argument
#1’ cannot convert UnityEngine.Transform' expression to type
UnityEngine.Vector3’
icouldn’t able to figure out the problem.
using UnityEngine;
using System.Collections;
public class camera : MonoBehaviour {
public Transform targetPoint;
public Transform startPoint;
public GameObject cameraObject;
void Start ()
{
EventManager._instance._buttonClick+=OnButtonClick;
//inventry_item1.renderer.enabled = false;
}
void OnDisable()
{
EventManager._instance._buttonClick-=OnButtonClick;
print ("event removed");
}
// Update is called once per frame
void Update () {
}
void OnButtonClick(GameObject obj)
{
if(obj.name == "item_1")
{
cameraObject.transform.position = Vector3.Lerp(startPoint, targetPoint, 2.0f);
}
}
}
need help.