13 lines
335 B
C#
13 lines
335 B
C#
|
using UnityEngine;
|
|||
|
|
|||
|
public class Billboard : MonoBehaviour
|
|||
|
{
|
|||
|
public float speed=1;
|
|||
|
void Update()
|
|||
|
{
|
|||
|
Vector3 targetPosition = Camera.main.transform.position;
|
|||
|
targetPosition.y = speed* transform.position.y; // جلوگیری از چرخش روی محور Y
|
|||
|
transform.LookAt(targetPosition);
|
|||
|
}
|
|||
|
}
|