Hey!
Basically i have a script that sets the position of a gameobject to a set value (0.52) but when i run the script and the conditions check out it just outputs some number that i never told it to do. Any help?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class panelPositioner : MonoBehaviour
{
public GameObject Panel;
void Start()
{
if (transform.position.y >= 30)
{
Panel.transform.position = new Vector3(Panel.transform.position.x, -0.52f, 0);
}
if (transform.position.y <= 30)
{
Panel.transform.position = new Vector3(Panel.transform.position.x, 0.52f, 0);
}
}
void Update()
{
}
}
And after that this happens whenever i test it. (Picture related)
