init
This commit is contained in:
commit
102013b228
1443 changed files with 1065651 additions and 0 deletions
20
Assets/Scripts/FollowPlayer.cs
Normal file
20
Assets/Scripts/FollowPlayer.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue