Instantiating Prefabs in Unity

Опубликовано: 15 Ноябрь 2024
на канале: XR Terra Class
70
4

This video shows you how to use code to instantiate copies of your prefab assets into your scene during runtime in Unity. We cover all the different parameters that can be passed to the Instantiate() function, as well as how to keep a reference to the spawned prefab so that you can perform functions on it as soon as it is instantiated.

XRTerra Links:
Programs and Courses: http://www.xrterra.com/programs
Newsletter Signup: https://www.xrterra.com/mailing-list-...

Creating And Editing Prefabs in Unity:    • Creating And Editing Prefabs in Unity  

00:00 Introducing Instantiation
01:15 Scene setup
02:52 Instantiation script timer
04:22 Testing the timer
04:46 Instantiating the cube
05:33 Assigning the prefab reference
06:18 Testing Instantiation
06:40 Instantiating as child
07:33 Testing instantiation as child
08:20 Instantiate in world space as child
09:19 Instantiate at position with rotation
10:34 Instantiate at point with parent
11:13 Referencing to the instantiated prefab
12:30 Testing adding force to spawned cubes
13:39 Outro

Instructor: Gregory Osborne