I’m using c sharp the error reads as No MonoBehavior scripts in the file, or their names do no match the file name.
using UnityEngine;
public class PlayerMovement : MonoBehaviour {
public Rigidbody rb;
// Update is called once per frame
void FixedUpdate ()
{
rb.AddForce (0, 0, 2000 * Time.deltaTime);
}
},
after trying to apply my script in unity i receive this error
The associated script can not be be loaded. Please fix any compile errors and assign a valid script.
also another error
No Mono Behavior scripts in the file, or their names do not match the file name.
I’m writing in c sharp on Mono Develop
using UnityEngine;
public class PlayerMovement : MonoBehaviour {
public Rigidbody rb;
void FixedUpdate ()
{
rb.AddForce (0, 0, 2000 * Time.deltaTime);
}
}
MonoBehaviours must be in a file of the same name - so the file holding this PlayerMovement class must be named PlayerMovement.cs