босс
This commit is contained in:
1 parent
76b6566e46
commit
11d290d572
49 files changed
+2562
-587
No files matched your search
@@ -39,6 +39,7 @@ public class CameraFollow : MonoBehaviour
|
||||
|
||||
void Start()
|
||||
{
|
||||
Time.timeScale = 1f;
|
||||
Vector3 angles = transform.eulerAngles;
|
||||
pitch = angles.x;
|
||||
yaw = angles.y;
|
||||
@@ -52,6 +53,17 @@ public class CameraFollow : MonoBehaviour
|
||||
|
||||
// Исключаем слой Ignore Raycast (слой 2) из проверки стен
|
||||
collisionLayers &= ~(1 << 2);
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
Quaternion rot = Quaternion.Euler(pitch, yaw, 0f);
|
||||
Vector3 targetFocus = target.position + (Vector3.up * height);
|
||||
Vector3 rightOffset = rot * Vector3.right * shoulderOffset;
|
||||
Vector3 desiredOrigin = targetFocus + rightOffset;
|
||||
Vector3 backDir = -(rot * Vector3.forward);
|
||||
transform.position = desiredOrigin + (backDir * distance);
|
||||
transform.rotation = rot;
|
||||
}
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
|
||||
Reference in new issue
Block a user