A gameObject Vector3is his transform.position. Therefore, if you have a link to it, you can simply use:
Vector3 lastPosition = gameObject.transform.position;
Or, if the save script is in gameObject, it can directly reference the conversion:
Vector3 lastPosition = transform.position;
See the Unity Docs for more information .
source
share