- Home /
Rotation help!
Hi, I'm pretty new to coding and making games.I need to make an cylinder rotate around its axis triggered by a touch and drag motion. This will be for android so I'm not sure if its the same as clicking and dragging the mouse. Help would be much appreciated!
Answer by stingman · Jun 30, 2012 at 01:49 AM
I would probably start with something a little less involved. When I started out with Unity I tried to jump in on things too advanced as well. Don't start here it will tear you apart. Slowly start studying the docs... the more you study them the better you will get. Start trying out tutorials too. I did the 2d platformer tutorial as well as a ton of online tutorials off youtube and such. But to get you started with what you want:
transform.Rotate is what you would use to rotate a cylinder around its axis. For touch controls you would look up the the touch phases in the docs under Input. For instance if a touch has began and is currently being held down you could write a script to perform a drag based on the starting and ending position of the touch. Try focusing on the rotate thing first though. It's a lot easier and you should be able to get something to rotate in no time. Just understand that the Transform of an object is the object's position, rotation and scale in 3D space. I think this should get you started.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Beginner need some help on Card Game 2 Answers
Gun Against Wall 1 Answer
Plinko Collision Problem 2 Answers