What is GameObject?

I have checked the internet for :

I see that Roll a ball tutorial uses this but I’m unsure what it is. Can someone explain:

  • what’s the difference between this GameObject and any other variable names - as in float, bool, text etc? Why can’t we use these instead of GameObject? Is GameObject special?

I’ve also seen games where they use “GameObject gameObject” as the declaration. So what does this mean?

GameObject is not a variable name. It’s a class specific to Unity that contains a bunch of other properties (for example transform) and everything else is put on top of. This post explains it pretty well I think:

https://discussions.unity.com/t/794103/3

These are types, not names.

What do you mean? They are for completely different things. What is the use case you have in mind where we would substitute a GameObject with a float?

It means you have a variable called gameObject, that is of type GameObject.

I don’t understand this link. Is there a better one? How do I know when to use GameObject?

Every entry in your project’s hierarchy is a GameObject.
7876051--1001404--upload_2022-2-7_18-41-36.png

That’s correct, Acid Arrow! And what do we add to GameObjects to make them more interesting?

Correct again, Acid Arrow! Components! Like Acid and like Arrow… and then we’d be firing an Acid Arrow!

And for the grand giveaway prize, what does Acid Arrow use to add components?

Why of course Acid Arrow uses AddComponent<T>(); on GameObjects!

Ahem. Seriously.

Unity’s component architecture

https://discussions.unity.com/t/808134/6