How to use GAMEOBJECTS and COMPONENTES from the Scene in scripts in Unity, Null reference exception

preview_player
Показать описание
Practically anything we want to do in Unity will require a script that is responsible for performing these tasks, these scripts will generally work with the objects in the scene and its components, for example if we want to control a ship we will read the motion inputs and apply the movement to the object of the ship with a certain speed to make this object move across the screen.
This video is the introduction to a series that focuses on obtaining those objects and components of the scene, how we can do to work with them from a Script, this is known as REFERENCE in programming, having an object or component stored in a variable allows us to access their information and use their functions, if they are public, this is done by applying the DOT OPERATOR on the variable that has stored the object or the specific component that we want to read or execute function.

References in programming is a very important concept in object oriented programming, in this series we are going to see different methods to achieve the same thing, to have the reference of a GameObject or scene component in a variable defined in a script.
In this video we also see what console errors can appear when we do not have the object reference but we still try to use it, the NullReferenceException and UnassignedReferenceException errors.

Introductory article of this series:

____________________________________________________________
*LINKS*

____________________________________________________________

#EN
Комментарии
Автор

Tq much I was searching for this playlist thanks❤️❤️❤️

djbinodflstudio
Автор

Great help for beginners like me thanks sir

djbinodflstudio
Автор

man ! u soo good easy, clear to understand ! thank you so much man ! keep it up

benachourmedwassim
Автор

I am so grateful that you posted this playlist. This was really well thought out in how the information is presented. And the bite sized videos make it so much more digestible. Keep it up! You got a new sub!

ericsze
Автор

How do this video only have 701 views?
This is some amazing work you're doing, I really appreciate your work. And if you can please upload English tutorials, so everybody can learn.

Krazy
Автор

can I use this for coins/gems/.. for example?

dragosl
join shbcf.ru