Question by
amzgames · Nov 08, 2019 at 01:08 PM ·
touchtouchscreen
Rotate object on mobile touch,How I can rotate an object more times?
Hello, I want to rotate an object by using touchscreen more times. All I can do right now is to rotate the object on Y axis 90 degrees. Here is my code: using UnityEngine;
public class RotateObj : MonoBehaviour
{
// Update is called once per frame
void Update()
{
if (Input.touchCount > 0)
{
Touch touch = Input.GetTouch(0);
GetComponent<Transform>().eulerAngles = new Vector3(0, 90, 0);
}
}
}
I want at any touch the object to change the position. Sorry if I disturb someone with my noob questions. Thank you a lot!
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612214512im_/https://answers.unity.com/themes/thub/images/avi.jpg)