Unityで、次のコードを打つと、
using UnityEngine;
public class PlayerFollowCamera : MonoBehaviour {
[SerializeField] private Transform player;
[SerializeField] private float distance = 15.0f;
[SerializeField] private Quaternion vRotation;
[SerializeField] public Quaternion hRotation;
[SerializeField] private float turnSpeed = 10.0f;
void Start ()
{
vRotation = Quaternion.Euler(30, 0, 0); hRotation = Quaternion.identity; transform.rotation = hRotation * vRotation; transform.position = Player.position - transform.rotation * Vector3.forward * distance; } void LateUpdate () {
if(Input.GetMouseButton(0))
hRotation *= Quaternion.Euler(0, Input.GetAxis("Mouse X") * turnSpeed, 0);
transform.rotation = hRotation * vRotati transform.position = Player.position - transform.rotation * Vector3.forward * distance; }
}
なぜか、エラーが起きます。どうすればいいでしょうか。出来たら正しいコードも書いてください。