So there’s the error that I get:
error CS0236: A field initializer cannot reference the nonstatic field, method, or property `UnityEngine.Component.transform’
and there’s my code:
using UnityEngine;
using System.Collections;
public class Controle : MonoBehaviour {
Vector3 Transform = transform.position;
// Update is called once per frame
void Update () {
float MoveHorizontal = Input.GetAxis ("Horizontal");
Transform.x = Transform.x + MoveHorizontal;
}
}
I am really confused and don’t understand what do i’ve done wrong…
English isn’t my first language so maybye it’s something not hard to understand