Skip to main content

Posts

Showing posts with the label prefabs

Loading Project Assets Through A Script (dynamically)

To do so, you first need to start by creating a new folder and naming it "Resources" You put whatever you want to load in the script in the folder, textures, prefabs, all that stuff. So if you want to Instantiate a prefab, you would simply put this in the code. var boat : GameObject = (Resources.Load("Boat")); Instantiate(boat, location, rotation); Simple right? If you want to get something out of a folder in the resources folder you just say: var smallBoat : GameObject = (Resources.Load("folder name/Small Boat")); Ta da. Easy. Read more at Unity's scripting Reference here

Unity's Available Prefabs.

Unity has on their site free packages and extentions you can download and get amazing prefabs. Such as this explosion prefab.