As the title says, I want to rotate a GameObject, stating at 0 speed, then slowly speeding up over time.
I have this code so far, and I think I am on the right lines, but I get the error:
Assets/Scripts/rotate.cs(7,41): error CS0236: A field initializer cannot reference the nonstatic field, method, or property `rotate.speed'
My code:
using UnityEngine;
using System.Collections;
public class rotate : MonoBehaviour {
public float speed = 0f;
public float incrementedspeed = speed + Time.deltaTime;
void Update () {
transform.Rotate(Vector2.right * incrementedspeed * Time.deltaTime);
}
}