Mediepals/Assets/Scripts/FollowPlayer.cs
Gerard Gascón 102013b228 init
2025-04-24 14:30:07 +02:00

20 lines
No EOL
482 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FollowPlayer : MonoBehaviour
{
[SerializeField] Transform jugador;
[SerializeField] Vector3 offset;
[SerializeField] float smooth = 0.125f;
// Update is called once per frame
void FixedUpdate()
{
transform.position = Vector3.Lerp(transform.position, jugador.position + offset, smooth);
//transform.position = Vector3.SmoothDamp();
}
}