Simple rotate script?

I searched for a rotate script but everything seemed either too complicated or not what I was looking for. All I want to do is rotate a cylinder to spin it. I’m new to programming I knew a little about it but forgot it all. :l

Sorry I’m a real noob I know

What language, left or right rotation?

Here is an example(this is C#):

void Update () {
        if (Input.GetKey(KeyCode.D))
        {
            transform.Rotate(0, 1, 0, 0);
        }

You have to press “D” in order to work. Delete the if statement if you want it to always rotate
This is C#. Also, please check the unity script reference: HERE

Sorry, C#
Wow, I had almost exactly that -_- I had
void Update () {
if (Input.GetKey(KeyCode.D))
{
transform.Rotate(0, 1, 0);
}
Thank you I should be able to get it from here

No problem, goodluck :slight_smile: