- Home /
Rotating an Object while Moving
I am trying to create a game that is 2.5D with an isometric camera that will look down on the player moving a top like object that will rotate repeatedly while the player moves the object left/right/up/down. Is it possible to rotate an object repeatedly while adding moving the object in various directions? If so, could you help explain how? Thanks
Hi
Not sure exactly what you mean. Do you mean that the object is part of the player, like a little radar dish on top of him that spins constantly whilst he moves, or do you mean that you want the player to able to push the object around it's centre point like a merry-go-round?
It is possible to rotate and move an object independently so shouldn't be a problem.
The player is the rotating object. Like a top that is constantly rotating that the player will control. How do you rotate an object constantly while moving the object.
Answer by Spider_newgent · Sep 11, 2013 at 06:03 PM
it's one thing getting an object to rotate constantly on one axis, and quite something else to get it to realistically behave like a spinning top. Presuming you just want it to rotate on the y axis, this script will basically do it.
var speed:float=3.0;
function Update () {
transform.Rotate(0,speed / Time.deltaTime , 0);
}
Incidentally, searching the forum for "automatically rotate an object each frame" would have found you the answer, for future reference.
Hope that helps.
spacehttp://answers.unity3d.com/questions/204110/rotating-my-character-only-while-moving-in-a-2d-pl.html
Or just simply animate the rotation.
You havent fully answered their question. You responded only how to rotate, not rotate AND move.