Page 1 of 1

Using VRIF asset and not loading saved info

Posted: Tue Jun 14, 2022 10:28 pm
by frostamation
So im using VRIF asset which is the vr backbone, not to important, but I am saving objects in their "snap zone" (just a holder of said objects the player can put in and take out of). I am using autosave for this script and everything saves and loads properly except for one item which is the "held item" on the script. this held item is the game object that is attached to the snap zone. without it i can not remove any objects from this snap zone. for whatever reason es3 does not load this variable into the script.

any help appreciated. thanks!

attached some screen shots if they help.
three.png
three.png (52.9 KiB) Viewed 904 times
two.png
two.png (27.22 KiB) Viewed 904 times
one.png
one.png (36.45 KiB) Viewed 904 times

Re: Using VRIF asset and not loading saved info

Posted: Wed Jun 15, 2022 9:39 am
by Joel
Hi there,

Do you get any warnings in console when loading?

It's likely that the reference to that GameObject doesn't exist between sessions, for example because it's generated at runtime so has a different reference ID each time.

All the best,
Joel

Re: Using VRIF asset and not loading saved info

Posted: Sat Jun 25, 2022 10:09 pm
by frostamation
There are no errors in console on load or exit. is there a way to manually set a reference ID?

Re: Using VRIF asset and not loading saved info

Posted: Sun Jun 26, 2022 10:13 am
by Joel
You can manually set a reference ID for an object using ES3ReferenceMgr.Current.Add(yourObject, id), and you should also call ES3ReferenceMgr.Current.Remove(yourObject) beforehand to ensure that any previously assigned ID is removed.

You would need to do this for each reference which is being saved/loaded.

All the best,
Joel