What is the DIFFERENCE between Transform and GameObject? (Unity Tutorial for Beginners)

preview_player
Показать описание
👍 Learn to make awesome games step-by-step from start to finish.
👇 Click on Show More

🔴 RELATED VIDEOS 🔴

💬 Do you get Game Objects and Transforms confused?
When you make a prefab reference, do you use Transform or Game Object?
The answer is you can use both! They are two different separate types but they work very much together, every Game Object always has a Transform component and every Transform always has to be attached to a Game Object.

📝 Some Links are Affiliate links which means it costs the same to you and I get a nice commission.
🌍 Get Code Monkey on Steam!
👍 Interactive Tutorials, Complete Games and More!

If you have any questions post them in the comments and I'll do my best to answer them.

See you next time!

#unitytutorial #unity3d #gamedev

--------------------------------------------------------------------
Hello and Welcome!
I'm your Code Monkey and here you will learn everything about Game Development in Unity using C#.

I've been developing games for several years with 8 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.

I do Unity Tutorials on just about every topic, Unity Tutorials for Beginners and Unity Tutorials for Advanced users.

--------------------------------------------------------------------
- Other great Unity channels:
--------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

🔍Did you know these differences? Which one do you prefer to use?
🔴RELATED VIDEOS🔴

CodeMonkeyUnity
Автор

Extra tip. You can reference any script that inherits from MonoBehaviour, and use it in the Instantiate. In this case the GameObject/Trasnform is created as usual, but what is returned is the instance of the component used in teh reference, saving a GetComponent in case you just need to access the script. (Very common to intantiate new rows of a grid in the UI)

cpu_UP
Автор

This is actually really helpful for me! I’ve relatively new to Unity, and I’ve always wondered what the difference is, and if one is better. Thanks for making this!!

CodeCrafter.
Автор

You could still access the transform when instancing the object as a GameObject with:
Transform instance =

Personally I prefer to instanciate prefabs as gameobjects as that feels like the more logical approach (in most of my personal use cases), but I like that you really go deep into explaining the nittygritty details about such abstract topics! Good video as always!

vonriddarn
Автор

A game object is the base class for any object that can be manipulated in a scene, its transform stores that objects position, rotation and scale in its local space.

HappyMatt
Автор

I already knew this. but, I like hearing your explanations because you do them so well and sometimes I get helpful tips that I've missed. Plus, it's always good to return to basics every once in a while, just to let it sink in...

digis_monkey_king
Автор

I already knew this, but came to confirm. Great video as always

gotayarito
Автор

to instantiate an object at a certain position/rotation, there is an overload of Instantiate() that does it all in one call. it's actually slower (i.e. extra code/CPU cycles) to set the position/rotation/parent on the returned transform.

jeffmccloud
Автор

nice video even for experienced users because we can learn in deepth about casual stuff in unity, thanks as always

apubetico
Автор

3:20 Thanks for going into the pros and cons when using one over the other.
So in the end it is just a thing of convenience depending on what you are most likely to do with an object.

pixelasm
Автор

Super helpful man .... love it. Thanks!

NewbNinjas
Автор

I am confused about this concept using transform or gameobject different times, this video was completely clean and understandable, thanks for this!

Relw
Автор

I'm multimedia engineer and developer whit Quest 3 and I forget this xD. Tnks Bro!

jhonuribe
Автор

you clear my confusion! thanks for making this video!

streetfighte
Автор

Of all your videos, this one has definitely the most mentions of "transform" and "gameobjects" per minute ;P

Kaikaku
Автор

I tend to think of GameObject as a container that holds various components, while a Transform is a component that contains position, rotation, and scale data. In the case of a Rect Transform, it'll also contain anchor point data.

MarushiaDark
Автор

Thanks for saving my mental health! I was so frustrating about this .transform/Transform things.

giovannigiorgio
Автор

love your vids, are you thinking of doing more dev reacts in the future? those videos have me hooked on your courses

scampbell
Автор

Pretty obvious, but I like to make the field/reference relevant to it's main function so I know what I'm using it for at a quick glance. E.G If I'm moving something I use a Transform, if I'm instantiating something or need to use it's components, I use a GameObject.

JohnWellingtonWells
Автор

I do godot, but your vids are always fun

imJeNaiKe