This commit is contained in:
2025-06-16 15:14:23 +02:00
committed by devbeni
parent 60fe4620ff
commit 4ff561284f
3174 changed files with 428263 additions and 0 deletions

View File

@ -0,0 +1,22 @@
using UnityEngine;
namespace Mirror.Examples.TopDownShooter
{
public class CameraTopDown : MonoBehaviour
{
public Transform playerTransform;
public Vector3 offset;
public float followSpeed = 5f;
#if !UNITY_SERVER
void LateUpdate()
{
if (playerTransform != null)
{
Vector3 targetPosition = playerTransform.position + offset;
transform.position = Vector3.Lerp(transform.position, targetPosition, followSpeed * Time.deltaTime);
}
}
#endif
}
}