I have a Ground Plane Stage with a child object. with a UI Button I´m trying to rotate this object. Unfortunately I do not get it to work.
Here is my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RotateObject : MonoBehaviour
{
public Rigidbody SOI;
bool rotateStatus = false;
public void rotateShit()
{
rotateStatus = !rotateStatus;
Debug.Log(transform.eulerAngles.x + " - " + transform.eulerAngles.y + " - " + transform.eulerAngles.z);
}
public void Update()
{
if (rotateStatus)
{
transform.Rotate(0, 45, 0, Space.World); //Vector3.up * rotationSpeed * Time.deltaTime, Space.World);
Debug.Log("Does something happen?");
}
}
}
The script is attached to the gameObject and linked to the onClick Event in the Button. If I click the button it only shows the Debug.Log function, but the object does not rotate. Hope someone can help me with that problem.
If I run my project on the iPad following will be logged to the console
(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)