Hello! sorry to bother again.
I am using the RememberTransform for my VR pickups (with the "Save Scene presence" on), but had some issues. When held, the items are parented to a persistent object (which also carries the hand models), so if you switch scenes the system remembers the last place the object was at (while held), so when you return, a duplicate item appears there on the floor. It also records the scale while the object is parented, so it returns an incorrect scale (picture a plate of food big enough to cover a cave's entrance, lol). The option "remember parent" didn't seem to help. But, I got it to work by telling my Pickup scripts to add or remove the RememberTranform script depending on whether the item is held or not (thus preventing any saving from occurring when switching scenes if an object is still held). That makes it work perfectly (the base prefab does need to have the RememberTransform script already there for some reason).
But, one issue remains... I have a few consumable items which can have multiple instances (matchsticks and oilcans to refuel/turn on a torch). If you leave a scene, and you've dropped several of these in the scene, once you return, only the very first item reappears. I tried to force the pickup script to give a new constantID to the item's constantId scripts but I guess the issue lies in the loading/spawning of the items.
Would it be possible to have the RememberTransform script mark duplicates as "instances", which can then simply be instantiated from the same original prefab path? There could be a "CanHaveInstances" toggle in the RememberTransform script to allow this behaviour. Or, is there anything I can add or modify, in the meantime, to allow this? Or is there some other way to do this I'm not aware of?
Anyway, any advice will be greatly appreciated.
Comments
It may be that a custom Remember script is necessary, so that a separate "isBeingHeld" boolean can be saved and affect the item accordingly when loaded.
Custom Remember scripts can normally be added by simply creating a new subclass of "Remember", but the RememberTransform is different because AC needs to do some "internal" work to bring back such components that no longer exist in the scene.
The Remember system also has a prerequisite that each object in the scene has a unique ID - which AC makes use of when deciding if an object needs bringing back or not. Essentially, it'll search the scene for an object with the same ID, and only spawn a new one if no such object is found.
Changing this prerequisite would have knock-on problems with other Remember components that may be attached. I'll have to delve in and see how feasible allowing for this behaviour can be.