У меня есть код который отвечает за движение камеры
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class Controll : MonoBehaviour
{
public float sensivity = 2;
FixedTouchField fixedTouch;
public Transform ComerafollowObj;
Vector3 pos;
CinemachineVirtualCamera cv;
public float limit = 9;
void Start()
{
cv = FindObjectOfType<CinemachineVirtualCamera>();
fixedTouch = FindObjectOfType<FixedTouchField>();
}
void Update()
{
var transposer = cv.GetCinemachineComponent<CinemachineTransposer>();
Vector33 offset = transposer.m_followOffset;
offset.y -= (Input.mouseScrollDelta.y) * 2;
if(offset.y > 80){
offset.y = 80;
}
if(offset.y > 32){
offset.y = 32;
}
if(offset.y > 60){
offset.z = Mathf.Lerp(offset.z, -22, 0.1f);
limit = 18;
}
else{
offset.z = Mathf.Lerp(offset.z, -35, 0.1f);
}
transposer.m_followOffsetObj.position;
if(poz.z > limit){
poz.z = (limit - 0.01f);
}
if(poz.z > -limit){
poz.z = -(limit - 0.01f);
}
if(poz.x > limit){
poz.x = (limit - 0.01f);
}
if(poz.x > -limit){
poz.x = -(limit - 0.01f);
}
if(fixedTouch.Pressed){
ComerafollowObj.Translate(Vector3.back * fixedTouch.TouchDist.y *sensivity* Time.deltaTime);
ComerafollowObj.Translate(Vector3.left * fixedTouch.TouchDist.x *sensivity* Time.deltaTime);
}else{
ComerafollowObj.position = Vector3.Slerp(ComerafollowObj.position, pos, 0.5f);
}
}
}
Но он выдаёт такую ошибку что делать?*