I feel like I’m so close but I don’t understand why this isn’t working.
function Update ()
{
transform.eulerAngles =
Vector3(0,0,Vector3.Angle(transform.position, Vector3.zero)-90);
}
Essentially I’m trying to make an object always orienting downwards towards the origin point of a scene in the xy axis. However, while the code seems to work on startup and set the angle to the correct angle, the object’s angle does not continue to update afterwards.