What is wrong with this script ? I am trying to make the cube or player move with left and right with keys
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class player : MonoBehaviour
{
[SerializeField]
private float _speed = 3.5f;
// Start is called before the first frame update
void Start()
{
//position
transform.position = new Vector3(0, 0, 0);
}
// Update is called once per frame
void Update()
{
ALSO, the complete error message contains everything you need to know to fix the error yourself.
Always start with the FIRST error in the console window, as sometimes that error causes or compounds some or all of the subsequent errors.
The important parts of the error message are:
the description of the error itself (google this; you are NEVER the first one!)
the file it occurred in (critical!)
the line number and character position (the two numbers in parentheses)
also possibly useful is the stack trace (all the lines of text in the lower console window)
All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don’t have to stop your progress and fiddle around with the forum.