- Home /
how do you make an object rotate on ios with your finger
on ios, when you swipe your finger across the screen, how do you get an object rotate at the speed of he finger swipe
Answer by Mr.Amsterdam · Jul 31, 2012 at 03:01 PM
If you want to measure the force with which the press on the screen of the device, you should use the accelerometer.
Answer by oxium · Aug 01, 2012 at 07:52 AM
1) code a simple rotation function (rotate the transform around a specific axis every frame)
2) control the rotation: change the speed, make sure it works with deltaTime
3) find a way to know when the screen is touched
4) compute the distance between the start & the end of the touch
5) also compute the time between the touch and the release
6) in OnRelease: call your rotation function using a touch ratio computed with what you did in 4) and 5)
you can't ask ppl to code something for you ;)
it's always easier to split up something into a list of smaller doable tasks
Then you just have to follow the steps !
You might have to google a bit but if you are a programmer (or want to become one) it's the only way to go !
Good luck :)
Your answer
Follow this Question
Related Questions
iOS LocalNotifications Not Changable 0 Answers
What do I need to add to make an iOS joystick movement have my character animate? 0 Answers
Strongly Typed Javascript on iOS 2 Answers
Execute JavaScript on iOS 0 Answers
Render text on sprite prefab - 2D iOS 4 Answers