When I save the code and try to play it, Unity tells me,
Assets/RandomBall.cs(15,62): error CS1525: Unexpected symbol Time', expecting
(‘, )',
,’, ;',
[', {', or
’
Assets/RandomBall.cs(18,69): error CS1525: Unexpected symbol Time', expecting
(‘, )',
,’, ;',
[', {', or
’
I am very new to Unity and C# so bear with me on this one. Thanks.
using UnityEngine;
using System.Collections;
public class RandomBall : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.position += new Vector3.right * Time.deltaTime * 8;
if (Collision) {
transform.position += new Vector3.left * Time.deltaTime * 8;
}
}