Voici mon script actuel :
Code : Tout sélectionner
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Cam : MonoBehaviour
{
public Transform player;
public Vector3 offset;
void Start()
{
}
void LateUpdate()
{
transform.position = new Vector3(player.position.x + offset.x, 0, offset.z); // Camera follows the player with specified offset position
}
}