Quantcast
Channel: Latest Questions by Filip5
Viewing all articles
Browse latest Browse all 8

Day/Night circle script error

$
0
0
Hello, I recive the following error after saving script. I ll provide booth texts below: Error: Assets/gametime.cs(30,49): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement Script: using UnityEngine; using System.Collections; public class gametime : MonoBehaviour { public Transform[] sun; public float dayCicleInMinutes =1; private const float SECOND = 1; private const float MINUTE = 60 * SECOND; private const float HOUR = 60 * MINUTE; private const float DAY = 24 * HOUR; private const float DEGREES_PER_SECOND = 360 / DAY; private float _degreeRotation; private float _timeOfDay; // Use this for initialization void Start () { _timeOfDay = 0; _degreeRotation = DEGREES_PER_SECOND * DEGREES_PER_SECOND / (dayCicleInMinutes * MINUTE); } // Update is called once per frame void Update () { sun[0].Rotate(new Vector3(_degreeRotation, 0, 0) * Time.deltaTime); _timeOfDay +- Time.deltaTime; Debug.Log(_timeOfDay); }} After saving the script evething is green (in script file) so I am not sure where's the problem. Thank you for your time and help Filip5 (Also sorry for tags, but seems the ones I added in couldn't be created as I have very few points yet...)

Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images