Parsing Error?

Hi, i’m a new coder and I got a parsing error at 16,1.

using UnityEngine;
using System.Collections;

public class scriptMove : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
if (Input.GetKeyDown (“space”)){
Transform.PositionX += 1;
}
}

Could you tell me how to fix this and how to fix this in the future for future reference? Thanks! Also thanks for all of the nice responces:)

first off you need to use [ code] [/ code] tags when pasting code into the forums, helps with the readability and includes the line numbers :slight_smile: sticky on them at the top of the scripting forum.

Transform.PositionX += 1;

should be

transform.position = new Vector3(transform.position.x+1, transform.position.y, transform.position.z);

(edited; if you are using c# you can’t update .x .y .z variables directly you have to update the entire position)

not the lower case letters. Unity is capital senstive. transform is the transform of the gameobject the script is attached to. Transform is the class etc.

using UnityEngine;
using System.Collections;

public class move : MonoBehaviour {

    // Use this for initialization
    void Start () {
   
    }
   
    // Update is called once per frame
    void Update() {if (Input.GetKeyDown ("space")){
        transform.position = new Vector3(transform.position.x+1, transform.position.y, transform.position.z);
    }
}

still got parsing error at 16,1 but the rest is good, but I dont understand what the parsing error is.

nevermind, fixed it :smile: