'I keep getting a "scriptcs" error in my C# code for Unity. Nothing I've seen on the internet is working
here is the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CarDrive : MonoBehaviour
{
[SerializedField] float steerSpeed = 1f;
[SerializedField] float moveSpeed = 0.02f;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
float steerAmount = Input.GetAxis("Horizontal") * steerSpeed * Time.deltaTime;
float moveAmount = Input.GetAxis("Vertical") * moveSpeed * Time.deltaTime;
transform.Translate(0,moveAmount,0);
transform.Rotate(0,0,-steerAmount);
}
}
and here is the error:
'scriptcs' is not recognized as an internal or external command, operable program or batch file.
Solution 1:[1]
This happened to me before, you need to either just save the script manually or go in edit
and then preferences
and then project files
and regenerate
.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | lemon |