Question by
OneDragutin · Jul 07, 2018 at 01:01 AM ·
prefabserializationruntimeinstancesync
Editing prefabs at runtime
Here is the problem:
I have a prefab and I need to sync prefab values with the player(script values, position, rotation). So since I can only do that at runtime here is what I did:
I spawn prefab at runtime that contains reference to the original prefab. Then using editor script I link instance object and original prefab so that instance will update values of the original prefab.
Is there any problem using this approach? Unity serializes prefab changes so when stopping scene everything seems to be saved and it works just fine. But in the past I had some weird bugs using this approach so right now I am worried... If you know anything about unity serialization of prefabs please help! :)
Comment