using UnityEngine;
using System.Collections;
public class BallCamera : MonoBehaviour
{
public Transform target; //needed to drag a rigidboady to target
public float relativeHeigth = 10.0f;
public float zDistance = 5.0f;
//×èÄáËÙ¶È
public float dampSpeed = 2;
void Update()
{
Vector3 newPos = target.position + new Vector3(0, relativeHeigth, -zDistance);
transform.position = Vector3.Lerp(transform.position, newPos, Time.deltaTime * dampSpeed);
}
}
======
FOrum about camera movement
http://forum.unity3d.com/threads/wow-camera-movement.16949/
using System.Collections;
public class BallCamera : MonoBehaviour
{
public Transform target; //needed to drag a rigidboady to target
public float relativeHeigth = 10.0f;
public float zDistance = 5.0f;
//×èÄáËÙ¶È
public float dampSpeed = 2;
void Update()
{
Vector3 newPos = target.position + new Vector3(0, relativeHeigth, -zDistance);
transform.position = Vector3.Lerp(transform.position, newPos, Time.deltaTime * dampSpeed);
}
}
======
FOrum about camera movement
http://forum.unity3d.com/threads/wow-camera-movement.16949/
沒有留言:
張貼留言