How increase and decrease speed.

Hi guys,
I’ve made this script for do an rotation, my question is, how can i do when I press a key increase oe decrease the rotaion-speed?
Thank you, and sorry for my bad english :stuck_out_tongue:

using UnityEngine;
using System.Collections;

public class Polpo : MonoBehaviour {

    public GameObject teller;
    float teller_rot;

void Awake()
{
    teller_rot = 0.0f;
}


void Start()
{

}


void Update()
{
    teller_rot = (teller_rot + Time.deltaTime * 60.0f) % 360.0f;
    teller.transform.localEulerAngles = new Vector3(0.0f, teller_rot, 0.0f);
}


}

void Update()
{
if (Input.GetKeyDown(“space”))
{
//Inside here do your rotation code
}
}

This means that when space is pressed the rotation is done.
I highly reccomend looking at the scripting documentation here. That will help understand input better.

I would try somthing like this.

(Discamer I dont wright stuff I c# I do everything in javascript, so if dosnt work, sorry)

    using UnityEngine;
    using System.Collections;
     
    public class Polpo : MonoBehaviour {
     
    public GameObject teller;
    float teller_rot;
     
    void Awake()
    {
    teller_rot = 0.0f;
    teller_rot_rate = 60.0f;
    }
     
     
    void Start()
    {
     
    }
     
     
    void Update()
    {
    teller_rot = (teller_rot + Time.deltaTime * teller_rot_rate) % 360.0f;
    teller.transform.localEulerAngles = new Vector3(0.0f, teller_rot, 0.0f);
    }

    if (Input.GetKeyDown("a"))
    {
         teller_rot_rate=teller_rot_rate-5;
    } 
    if (Input.GetKeyDown("d"))
    {
         teller_rot_rate=teller_rot_rate+5;
    } 
     
    }

using UnityEngine;
using System.Collections;

public class Polpo : MonoBehaviour
{

    public GameObject teller;
    float teller_rot;
    float speed = 60f;

    void Awake()
    {
        teller_rot = 0.0f;
    }

    void Update()
    {
        if (Input.GetKey(KeyCode.UpArrow)) {
            speed += 1;
        }
        if (Input.GetKey(KeyCode.DownArrow))
        {
            speed -= 1;
        }
        teller_rot = teller_rot + Time.deltaTime * speed;
        teller.transform.localEulerAngles = new Vector3(0.0f, teller_rot, 0.0f);
    }


}

I believe this is what you want.