Free “Rotating Object” Script for Unity3D in C#

Free Rotating Object Script for Unity3D, written in C#

Feel free to change the class name from “CoinMovement” to something more useful for you like: “RotatingObjectScript”. Just make sure whenever you create a new C# script in Unity that the name of the script and the name of the class match. :)

Here’s a demonstration of what it does and how to use it :

  • blipton

    Can this be used to open an existing 3d file (.stp or similar) in order to programatically rotate and view the object?

    If not, do you have any recommendation that could be a good starting point (ex. assimp?)


    • cadenburleson

      Do you mean have the ‘user’ get live input control over rotation direction?

  • karthick


    i want to stop rotating after a given time or rotation count.can you help me out bro

  • Jamie Wright


    How did you create the “+50” ?

    Thank you for your answer in advance.

  • Jim

    With Unity 5.x you need to add a private variable:

    private Collider coinObject;

    Then in the Awake()

    public void Awake()
    coinObject = GetComponent();

    Finally in the Start() you need to replace the collider.isTrigger = true; with the following:

    coinObject.isTrigger = true;

    Now Unity will not complain…

    Thank you for the script like what you did…