How does DontDestroyOnLoad work?

I’m trying to make a options menu which would require having variables work across multiple scenes. I read that DontDestroyOnLoad works but i don’t know how to use it.
I’m still new to programming.

use:

DontDestroyOnLoad(this.gameObject);

It will save the object over scenes. :slight_smile: