C#
1using UnityEngine; 2using System.Collections; 3 4public class CameraScript : MonoBehaviour { 5 6 private GameObject player = null; 7 private Vector3 offset = Vector3.zero; 8 9 void Start () { 10 player = GameObject.FindGameObjectWithTag("Player"); 11 offset = transform.position - player.transform.position; 12 } 13 14 void LateUpdate () { 15 Vector3 newPosition = transform.position; 16 newPosition.x = player.transform.position.x + offset.x; 17 newPosition.y = player.transform.position.y + offset.y; 18 newPosition.z = player.transform.position.z + offset.z; 19 transform.position = newPosition; 20 } 21}
これで、尾行はするのですが向きも合わせたいです。
回答お願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。