Saving input field text

Hello. I have been trying to create to create a script that saves input field text when you leave scene and come back to it the input field text would still be there. Right now I am using DontDestroyOnLoad however my script is not working. I will post my script below and if anyone has any ideas that would be greatly appreciated.

using UnityEngine;
using System.Collections;
using UnityEngine.UI;


public class DontDestroyOnLoad : MonoBehaviour {

	public InputField 1Text;
	public InputField 2Text;
	public InputField 3Text;


	void Start () {
	
	}
	
	void awake () {
	
		DontDestroyOnLoad (1Text);
		DontDestroyOnLoad (2Text);
		DontDestroyOnLoad (3Text);


	}
}

DontDestroyOnLoad is a function that allows you to mark root-level game objects so they are not destroyed during a scene Change.

Here you’ve written a component called DontDestroyOnLoad (that’s weird, but not implicitly wrong) your “awake” function should be “Awake” with a capital A.

There’s many many ways to make this happen. The easiest would be a static field or saving the strings to PlayerPrefs. Do a little research on both of these concepts to learn more about them and how they work.

Static field:

public static string inputText;

Player Prefs:

OnDisable
PlayerPrefs.SetString("inputText1", inputField1.Text);

OnEnable
inputField1.Text = PlayerPrefs.GetString("inputText1");