Hello. I want to call a function on another script but a got an error how can I fix this :'( Im a beginner please help. The Script name that I want to call its function is Save Manager.

public bool enter;
public GameObject SaveMessage;
void Start () {
enter = false;
SaveManager Autosave = GetComponent().SaveState(); // this line tells about “cannot implicitly convert type ‘void’ to ‘Save Manager’”
}

Does SaveState() return void? I’m guessing it does, cause whatever SaveState() returns is being assigned to your variable ‘Autosave’, which is of type SaveManager. I’m guessing you don’t want to do that assignment. So just do:

  GetComponent<SaveManager>().SaveState();

Without assigning the result to SaveManager Autosave…