- Home /
Beginner question
Hi there. i am new to unity and got a little question. i made a little platform in googlesketcup and imported it in unity now i want the platform to rotate like this: http://www.youtube.com/watch?v=D30Y2g3puYA only the bigplatform nothing else. so i can choose the own speed by holding q to get faster and a to slow it down.
any one can help me with this? greetz!
"Beginner question" as a question title tells nothing about your question. You should really change this to something like: "Beginners Question: Rotatation" or Beginners "Question: Totating a big platform"
Answer by Sonaten · Dec 08, 2012 at 10:43 PM
Rotating your object you could use
yRotation += Input.GetAxis("Horizontal");
transform.eulerAngles = new Vector3(10, yRotation, 0);
or this
transform.RotateAround(Vector3.zero, Vector3.up, 20 * Time.deltaTime);
You would just have to make a script with one of these functions, and rewrite them to fit your purpose. Then find the object you wish to rotate, and attach the script.
Dependent on how much of a beginner you are. I would suggest taking a tutorial such as such as this beginners guide on TutsPlus. It is done in Javascript. In the long run, I would however suggest picking up C# as this is much less restrictive.
Enjoy.