This code is attached to a square sprite. I have no other scripts. I am trying to get GUI.Label to work for future use. It does not display the text.
using System;
using UnityEngine;
public class SquareScript : MonoBehaviour
{
//float accel = 1f;
void Start()
{
//transform.position = new Vector3(1, 0);
}
void Update()
{
//transform.position = new Vector3((float)Math.Cos(Math.Pow(Time.time, 2) * accel / 2), (float)Math.Sin(Math.Pow(Time.time, 2) * accel / 2));
}
void OnGUI()
{
GUI.Label(new Rect(-1f, -1f, 2f, 2f), "Where is the text?");
}
}
By the way I get this warning but I had problems before having this warning so I doubt it has anything to do with this. I should probably put this second part in a seperate question, but because there is a slight chance it might have something to do with this I will include it here.
Unable to find player assembly: C:\Users\User\My project\Temp\StagingArea\Data\Managed\UnityEngine.TestRunner.dll
UnityEngine.Debug:LogWarning (object)
Unity.Burst.Editor.BurstAotCompiler:OnPostBuildPlayerScriptDLLsImpl (UnityEditor.Build.Reporting.BuildReport) (at Library/PackageCache/com.unity.burst@1.6.6/Editor/BurstAotCompiler.cs:350)
Unity.Burst.Editor.BurstAotCompiler:OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport) (at Library/PackageCache/com.unity.burst@1.6.6/Editor/BurstAotCompiler.cs:208)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()