DontDestroyOnLoad problem

I have this code that does not work:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class inmortal : MonoBehaviour {
float a;
void awake(){
DontDestroyOnLoad(gameObject);

iniciobutom ball2 = GetComponent ();
a = ball2.ball1;

}

}

but this one work :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class inmortal:MonoBehaviour{
void Awake () {
DontDestroyOnLoad(gameObject);
Debug.Log (“awake called”);
}
}
WHY ? what can I change to make it work P.S I’m new

In first you have void awake() so it’s not the unity’s function, it must be exactly void Awake()
That’s why.

And please, use code tags properly next time.

Regards.