16 lines
263 B
C#
16 lines
263 B
C#
using UnityEngine;
|
|
|
|
public class HealthBarFollow : MonoBehaviour
|
|
{
|
|
public Transform target;
|
|
public Vector3 offset;
|
|
|
|
void Update()
|
|
{
|
|
if (target != null)
|
|
{
|
|
transform.position = target.position + offset;
|
|
}
|
|
}
|
|
}
|