Hi, so I’m working on a platformer game, and I’m using placeholder models for now. Right now, this is the script (named SCPlayerControls) I’m using for is below:
public class NewBehaviourScript : MonoBehaviour
{
public float speed;
public float jumpforce;
private float moveInput;
private Rigidbody SC;
void Start()
{
SC = GetComponent<Rigidbody>();
}
private void FixedUpdate()
{
moveInput = Input.GetAxis("Horizontal");
SC.velocity = new Vector2(moveInput * speed, SC.velocity.y);
}
However, when I saved the script in Unity, it gave me a “Missing (Mono Script)” with text saying “The associated script cannot be loaded. Please fix any compile errors and assign a valid script.”
I was also using both a Rigidbody and Box Collider script for both the placeholder player and the test platform, but do I need to do something different with anything aside from that?