{"author_link":"\/users\/jishenaz","author_name":"jishenaz","author_uid":"jishenaz","comments":[],"epoch":1493131989,"event":"LD38","format":"md","ldjam_node_id":28299,"likes":3,"metadata":{"p_key":"91407","p_author":"jishenaz","p_authorkey":"1003029","p_urlkey":"304318","p_title":"Never link a prefab to itself","p_cat":"LDJam ","p_event":"LD38","p_time":"1493131989","p_likes":"3","p_comments":"0","p_status":"WAYBACK","us_key":"1003029","us_name":"jishenaz","us_username":"jishenaz","event_start":"1492732800","event_key":"69","event_name":"LD 38"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD38","removed_author":false},"_superparent":9405,"_trust":1,"author":3029,"body":"During the development of [Caelium Alpha](https:\/\/ldjam.com\/events\/ludum-dare\/38\/caelium-alpha) (using Unity), I was trying to fix weird bug in which trying to spawn 1 planet actually spawns multiple planets. I was not able to fix the bug by the time the LD Jam ended, which was obviously concerning. Now I wake up the next morning to fix the problem, and I found out that a prefab (for planets, stars, etc.) that references itself was being set to a gameObject, even though I never asked for that.\n\nLong story short, if you have a prefab with a script that references that very same prefab itself, the prefab will turn into a cloned gameObject. Very annoying \"bug\", but unfortunately Unity says [in the forums](https:\/\/forum.unity3d.com\/threads\/reference-to-prefab-changing-to-clone-self-reference.57312\/) that it was intentionally designed. I still don't understand how, but the moral of the story is:\n\nDon't let a prefab reference itself. It can jeopardize your development time (like it did for me).","comments":0,"created":"2017-04-25T14:39:51Z","files":[],"files-timestamp":0,"id":28299,"love":3,"love-timestamp":"2017-04-25T15:06:46Z","meta":[],"modified":"2017-04-25T15:06:46Z","name":"Never link a prefab to itself","node-timestamp":"2017-04-25T14:53:09Z","parent":17540,"parents":[1,5,9,9405,17540],"path":"\/events\/ludum-dare\/38\/caelium-alpha\/never-link-a-prefab-to-itself","published":"2017-04-25T14:53:09Z","scope":"public","slug":"never-link-a-prefab-to-itself","subsubtype":"","subtype":"","type":"post","version":65755},"node_metadata":{"n_key":"28299","n_urlkey":"304318","n_parent":"17540","n_path":"\/events\/ludum-dare\/38\/caelium-alpha\/never-link-a-prefab-to-itself","n_slug":"never-link-a-prefab-to-itself","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"3029","n_created":"1493131191","n_modified":"1493132806","n_version":"65755","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/38\/caelium-alpha\/never-link-a-prefab-to-itself","text":"During the development of [Caelium Alpha](https:\/\/ldjam.com\/events\/ludum-dare\/38\/caelium-alpha) (using Unity), I was trying to fix weird bug in which trying to spawn 1 planet actually spawns multiple planets. I was not able to fix the bug by the time the LD Jam ended, which was obviously concerning. Now I wake up the next morning to fix the problem, and I found out that a prefab (for planets, stars, etc.) that references itself was being set to a gameObject, even though I never asked for that.\n\nLong story short, if you have a prefab with a script that references that very same prefab itself, the prefab will turn into a cloned gameObject. Very annoying \"bug\", but unfortunately Unity says [in the forums](https:\/\/forum.unity3d.com\/threads\/reference-to-prefab-changing-to-clone-self-reference.57312\/) that it was intentionally designed. I still don't understand how, but the moral of the story is:\n\nDon't let a prefab reference itself. It can jeopardize your development time (like it did for me).","title":"Never link a prefab to itself","wayback_source":[]}