UI update 02
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace KD.Destro2D{
|
||||
public class BasicPlayerFollow : MonoBehaviour
|
||||
{
|
||||
public Transform player;
|
||||
public float dist = -10;
|
||||
public float offsetY = 2;
|
||||
public float speed = 5;
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void LateUpdate()
|
||||
{
|
||||
Vector3 targetpos = new Vector3(player.position.x,player.position.y + offsetY,dist);
|
||||
transform.position = Vector3.Lerp(transform.position,targetpos,speed * Time.deltaTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user