Open reymesson1 opened 5 years ago
GameObject a = new GameObject("BallObject");
myGameObject.AddComponent
public class PlayerScript : MonoBehaviour { Rigidbody rb;
void Start() {
rb = GetComponent<Rigidbody>();
}
void FixedUpdate() {
rb.AddForce(Vector3.up);
}
}
https://stackoverflow.com/questions/51959242/add-script-to-gameobject-can-not-find-the-script