помогите пожалуйста исправить скрипт для управления камерой
Код
using UnityEngine;
using System.Collections;
public class ThirdPersonCameraCorrection : MonoBehaviour {
public Transform target;
public float distanceOffset = 0.25f;
void Update()
{
transform.position = ThirdPersonCamera.positionCorrection.position;
transform.forward = ThirdPersonCamera.positionCorrection.forward;
RaycastHit hit;
Vector3 trueTargetPosition = target.transform.position;
if (Physics.Linecast (trueTargetPosition, transform.position, out hit))
{
float tempDistance = Vector3.Distance (trueTargetPosition, hit.point);
Vector3 position = target.position - (transform.rotation * Vector3.forward * (tempDistance - distanceOffset));
transform.position = new Vector3(position.x, ThirdPersonCamera.targetHeight, position.z);
}
}
}
выдает ошибки:
Assets/cameracontroll.cs(11,56): error CS0117: `ThirdPersonCamera' does not contain a definition for `positionCorrection'
Assets/cameracontroll.cs(12,55): error CS0117: `ThirdPersonCamera' does not contain a definition for `positionCorrection'
Assets/cameracontroll.cs(19,88): error CS0122: `ThirdPersonCamera.targetHeight' is inaccessible due to its protection level
Assets/cameracontroll.cs(19,113): error CS1502: The best overloaded method match for `UnityEngine.Vector3.Vector3(float, float, float)' has some invalid arguments
Assets/cameracontroll.cs(19,113): error CS1503: Argument `#2' cannot convert `object' expression to type `float'