Missing Mono Scripts for a Platformer

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?

No it is not:

That’s not the same.

Those two have to match PERFECTLY, right down to the capitalization, always.

ALSO… in the future, if you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: https://discussions.unity.com/t/481379

Alright, that was the issue. After adding constraints, it works just fine now. Sorry about the hassle, since it was pretty easy fix I should have figured out myself.

Also, you’re using a 3D Rigidbody so I’m trying to figure out why this is in the 2D features sub-forum. I’d say use the scripting sub-forum for things like this.