- Home /
Question by
Particalister · May 25, 2017 at 02:53 PM ·
c#rotationc# tutorial
Getting the exactly rotation of an Object placed in UI
Hi guys.. as the title says.. How can i get the exactly rotation of an object ?
This is my current script but not working...
public float speed = 3; public RectTransform Arrow; public bool isMinus; [Header("Game Assembly")] public Text CurrTime; public void OnClick() {
if (Arrow.transform.eulerAngles.z >= 0 && Arrow.transform.eulerAngles.z < 335)
{
int MinusX = Random.Range (1, 10);
int HourX = Random.Range (1, 12);
CurrTime.text = HourX.ToString ();
SoundManager.Instance.PlaySound (SoundManager.Instance.TimeTick);
//
if (MinusX >= 1 && MinusX <= 5) {
if (isMinus == false) {
isMinus = true;
}
Debug.Log ("Minus is enabled " + MinusX);
}
if (MinusX >= 6 && MinusX <= 10) {
if (isMinus == true) {
isMinus = false;
}
Debug.Log ("Minus is disabled " + MinusX);
}
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612122611im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Multiple Cars not working 1 Answer
How to write turret aiming for enemy AI 2d side tank? 1 Answer
Distribute terrain in zones 3 Answers