Quantcast
Channel: Questions in topic: "dynamically"
Viewing all articles
Browse latest Browse all 152

How to assign a gameObject to prefab (in-game via code)?

$
0
0
Hi , I wondered if anyone knew how to assign a gameObject to a prefab via code in-game. What I'm doing at the moment is letting the user make a car in one scene(garage) and I want to transfer the car to another scene(track) to instantiate it for multiplayer. I have tried using- EditorUtility.CreateEmptyPrefab() -but this only works in the editor , I also read in order to do this you need to add this to Assets/Editor folder , this stopped the build error but didn't run the script. Thanks in advanced for any help :)

Viewing all articles
Browse latest Browse all 152

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>