Gameobjects become unset

joran

New member
Gameobjects that are part of the scene become unset in both itemactions and item definitions ... there is a transform i link to in each of those and it keeps getting unset... is this a known issue(or is it something i am doing wrong?)? is there someway to prevent this from happening? is there an alternate best practice (I hope not GameObject.Find, as i need to get this somewhat frequently at runtime)

(note that it works fine for prefabs, this is only happens with gameobjects in the scene)
 
I think i figured out whats going on ... when i open the demo scene the targets no longer exist but the inventory does ...
 
That's how Unity works. ItemActionSets and Item Definitions are scriptable objects, they cannot reference objects within a scene. They can only reference other assests (scriptable object, prefabs, audioclips, materials, sprites, etc...)

The work around is to use something to identify the objects in the scene using IDs.
I'm actually adding a new features in v1.1.4 that could help with that. You'll still need some custom code though
 
Top