Hi,I m beginner and I write script but got 2 errors which are shown below
1- Assets/Scripts/NedmethodScript.cs(1,254): error CS1041: Identifier expected
2-Assets/Scripts/NedmethodScript.cs(1,254): error CS8025: Parsing error
Please resolve my issue.I m working on Roll a ball Project as learning so kindly help me as soon as possible
using UnityEngine;
using System.Collections;
public class CubeScript : MonoBehaviour {
float MAX_SPEED = 1;
Vector3 speed = Vector3.zero;
public GameObject CameraGO;
// Use this for initialization
void Start () {
CameraGO.transform.position = this.transform.position -
new Vector3 (0, -11, 0);
}
// Update is called once per frame
void Update () {
if (speed.x > 0.01f) {
speed.x -= .01f;
}
if (speed.z > 0.01f) {
speed.z -= .01f;
}
this.transform.position += speed;
if (Input.GetKey (KeyCode.UpArrow)) {
speed = new Vector3(0,0,MAX_SPEED);
}
if(Input.GetKey(KeyCode.RightArrow))
speed = new Vector3(MAX_SPEED,0,0);
/*if(Input.GetKey(KeyCode.LeftArrow))
this.transform.position += new Vector3 (-speed, 0, 0);
if(Input.GetKey(KeyCode.DownArrow))
this.transform.position += new Vector3 (0, 0, -speed);
*/
float distance = Vector3.Distance (this.transform.position, CameraGO.transform.position);
//if(Mathf.Abs(this.transform.position.z - CameraGO.transform.position.z) > 60)
CameraGO.transform.position = this.transform.position -
new Vector3 (0, -11, 30);
}
}
Please edit your question and add your code there instead of using screenshots. You can paste in your code and use the 101010 button to format it.
– Dave-Carlile