for some reason, this script doesn't work, it Logs the messages, but it dosn't actually load... it saves. Is there something I'm not doing? it works when i say PlayerPrefsX...... in the script i'm referencing this one to, but I just want to reference this one instad of typing "PlayerPrefsX......."
Any and all help would be appreciated!
here's a way to use Save();
and Game.Load(); is set up the same way, but for some reason doesn't even work besides Debug.log();
That won't work since Vector3 and Quaternion are value types, not reference types and additionally Transform.position and .rotation are properties.
Change your methods to
That will work because Transform is a class and therefore a reference type.
In the case that you want to save an arbitrary Vector3 and Quaternion you have to use the
When using out the variables don't have to be initialized when passing to the function but you can't read them inside your function until you assigned them.
When using ref the variables have to be initialized and can be read inside the function. They just act as a reference type.