- Home /
Question by
Cekavicius · Oct 23, 2016 at 04:52 PM ·
cloneobject reference
Text object reference breaks after a player clone is instantiated.
So i'm making a 2 D shooter game with C#. i have a bullet count text which tells how much bullets u have in the current magazine and how much are left (for example 26/90 ). everything works fine until the player dies and respawns ( the player is respawned by a script instantiating a player's prefab ). then i get the error : "object reference not set to an instance of an object" which links to the bullet count text and so the bullet count text stops updating and also prevents me from shooting. I checked the player's prefab and the problem seems to be that the text reference just doesn't save on the prefab. how can i fix this?
thanks for any help!! :)
Comment