- Home /
Difference between Vector3, Transform and GameObject
Hi all,
I know this is a silly question though i'm trying to articulate in words as to the difference between Vector3, Transform and GameObject.
I vaguely know the difference i think and have searched the interwebz for answers though im getting confused.
Could someone explain to me in plain english the differences?
Cheers
Answer by Yoshinator2 · Dec 05, 2016 at 03:28 AM
A Vector 3 is a set of 3 numbers. X,Y,Z Example: (1, 3, 5) A Transform is a game objects position, rotation, and scale in the scene, and can be seen in the inspector when you have the object selected. A GameObject is anything that is in the scene. Game Objects have Transforms if they are in the scene, because they have a position, rotation, and scale. Please accept this answer if this is what you were looking for. If not, just ask!
Answer by syven · Dec 05, 2016 at 07:32 AM
Vector3 is a point in a 3D-Room.
Transform is a property attached to GameObjects. For example: Your scene is a 3D-Room. Your GameObject would be then a Point in that room with a Position, Rotation and Scale. These 3 variables are Vector3's.
And finally a GameObject is your Object in your Hierarchy. It can be a 3D-Model, soundfile or even an empty object with components (scripts and stuff) on it. (Excample) If you want to disable a GameObject you have to do this: gameObject.SetActive(bool);
You also can call GameObject from Transform and Transform from GameObject: transform.gameObject; gameObject.transform;
Connection between these 3: GameObject contains Transform, Transform contains Vector3 (position).
I hope i could help.
Your answer
Follow this Question
Related Questions
Reverse Look up ( have transform want the gameObject of that transform) 2 Answers
unknown axis of rotation 1 Answer
how do i fix my script in the content below? 0 Answers
Get the Vector position of the player object when clicking another object C# 1 Answer
Rotating a Vector3 in Instantiation 1 Answer