This question already has an answer here:

Ok So i making this simple platformer with a ball. So basically i have A pickup / Collectible that is a Coin. I want the coin till it gets collected by the ball to keep rotating around it axis . Also I know I could do this by adding a Animation but I would prefer doing it Via A C# Script. So please if anybody knows how then Tell me. Thanks


marked as duplicate by Alexandre Vaillancourt, MAnd, MichaelHouse Apr 8 '16 at 16:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • \$\begingroup\$ -1 "This question does not show any research effort" \$\endgroup\$ – Alexandre Vaillancourt Mar 30 '16 at 12:50

If you are rotating around the x axis, you can use this code:

float speed =5f;
void Update () {
        transform.Rotate(Vector3.right *speed * Time.deltaTime);

Not the answer you're looking for? Browse other questions tagged or ask your own question.