- Home /
Question by
giodaguido · Feb 19, 2013 at 08:56 PM ·
coroutinetimeeventrotatearound
RotateAround over a set period of time
Hi, I am trying to use RotateAround to move a set of cubes around 90 degrees to both the left and the right. I have been using this code to do so and it has worked the best in terms of fluidity etc.
void rightSwipe (SwipeInfo sw) {
if ((sw.angle >= 0 && sw.angle <= 20) || (sw.angle >= 340 && sw.angle <= 360)) {
transform.RotateAround(playerPosition.playerCurrentPosition,Vector3.back,mySpeed * Time.deltaTime);
}
I would like to perform this function over a set period of the time and I am wondering whether it should use a coroutine or a loop?
Thank you
Comment