16 lines
433 B
C#
16 lines
433 B
C#
using UnityEngine;
|
|
|
|
public class prop_easterballoon : MonoBehaviour
|
|
{
|
|
|
|
private void Update()
|
|
{
|
|
if (transform.parent == null) return;
|
|
if (transform.parent.parent == null) return;
|
|
var forward = transform.parent.parent.position - transform.position;
|
|
forward.y = 0f;
|
|
if (forward.sqrMagnitude > 0.001f)
|
|
transform.rotation = Quaternion.LookRotation(forward, Vector3.up);
|
|
}
|
|
}
|