- Home /
how to rotate 3d model in touch using guy texture object
I want to press on guitexture which instructs 3d model to rotate
Comment
Answer by Ejlersen · Dec 23, 2010 at 02:51 PM
One way of doing it:
public Transform obj = null; // Reference to your model public float speed = 5.0f; // Rotation speed
void OnGUI() { if (GUI.Button(new Rect(0.0f, 0.0f, 64.0f, 16.0f), "Left")) obj.Rotate(-speed Time.deltatime); if (GUI.Button(new Rect(70.0f, 0.0f, 64.0f, 16.0f), "Right")) obj.Rotate(speed Time.deltatime); }
Your answer
Follow this Question
Related Questions
Rotate camera smoothly to certain degrees with iphone touch 2 Answers
rotate object to touch position 1 Answer
Degree from point? 2 Answers
how do I create a 3d model viewer app using unity 0 Answers
Rotate on drag for IOS? 1 Answer