|
Is it possible (or sensible) to change a "prefab" in a script before passing it to instantiate? For example, something like the following:
I tried this with Network.Instantiate, and it broke horribly and silently (at which I'm not surprised). Now I'm wondering if this would work with the standard Instantiate function?
(comments are locked)
|
|
It does work, but it has the consequence that the altered Prefab will remain changed when you leave play mode. You're literally altering the Prefab, so the changes persist beyond runtime. Ok, thanks. It's interesting to know that unity still regards it as a prefab rather than a GameObject as its type indicates. Oh well.
Jan 03 '11 at 12:24 PM
Matthew A
(comments are locked)
|

I have actually never tried to do so, but why not change it after you have initialised it?
Well, if this is a script in my player object that fires bullets, I was hoping to set the owner of every bullet instantiated by this player by altering the prefab once for each player, instead of setting it after every instantiation of a bullet on every player.