I’ve been trying to find a way to use the new UI in a similar way to the old repeat button, but so far this code just freezes unity while buttonPressed = true instead of incrementing the models rotation every frame like I would expect. Any help would be appreciated.
public void RotateModel(string XYZ)
{
while (buttonPressed)
{
if (XYZ == "x")
{
if (button.tag.Equals("Plus"))
{
model.transform.Rotate(x += .25f, 0, 0);
}
if (button.tag.Equals("Minus"))
{
model.transform.Rotate(x -= .25f, 0, 0);
}
}