every time i try to attach my script to a sphere (im taking a class), i get the error message that says **"Can't add script component 'move' because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match."** i have tried many things from retyping my code and deleting things but i dont know how to fix this. ill put my code so you might be able to see what is wrong. my names match too.
using System.Collections;
using System.Collections.Generic;
using System.Net.Sockets;
using UnityEngine;
public class Move : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.Translate(Input.GetAxis("Horizontal"), 0, 0);
}
}
↧