Menu Close

Game Objects

Live Training 30 Sept 2013 – Game Objects    (Unity)

3:23 – Everything in video games is based off a coordinate system. The coordinate system is mathematical in nature, based off a cartesian coordinate system

4:15 – Unity uses an X-Y-Z coordinate system, unless you do 2D which uses X-Y. X is left to right, Y is up and down, and Z is in and out(like zoom on a camera, zoom in, zoom out). And just so you know, there are other game engines that use a different system, like instead of Z as in and out like in Unity, it’s up and down. If you switch to something different, or switch to Unity, you might need to get reuse to what the engine uses.

8:43 – There are two kinds of coordinate systems. The first one, the world coordinate system, which is the coordinate grid of the entire game. While the second one is the local coordinate system, which is a coordinate system relative to an object’s center. For example, the local coordinate system of the cube’s center is (0,0,0), and all of it’s corners are relative to the center. For example, the corners if equal distance from the center(cube), would be, (3,3,3,), (-3,3,3), (3,-3,3), and so on.

11:26 – Game objects are at its root, the very fundamental element of a scene. Game objects basically make up everything we can see, interact with, and work with in a Unity game. A scene inside of a game for example, could be made up of a lot of game objects. Such as, the player, the sun, cars, bullets, enemies, buildings, walls, blocks, buckets, clouds, etc.

12:16 – At their core, game objects are basically just empty containers, like buckets, that you can stack many things into, onto, around, and add all sorts of functionalities to.

12:37 – To create an object go to GameObject then click create empty. Or just ctrl+shift+n. This will create an object that this is basically nothing, it will be named GameObject and added to your hierarchy. With this plank object you can change its name, and you can add components to give it functionality.

15:35 – ctrl+z is to undo. (Kind of random, I know)

16:00 – A plain is a 3D shape that is really 2D. It’s flat and useful to put stuff on. Also the underside of it is not rendered. This is useful as a back stop, or to add a texture onto, and it doesn’t cast a shadow. Or maybe you just don’t want somebody to be able to see from one side.

23:12 – Components can be added to any game object, or basically anything we want, and give it any functionality that we want.

24:23 – If you add a light, Unity will automatically turn on off universal lighting. If you want to turn it back on just click the toggle button above the screen. Universal lighting gives light to everything in the scene. But if you want just a light in a tunnel for example, then you will need to add a light component to one of the objects in the tunnel.

26:02 – The transform on a object is basically that object’s position, rotation, and scale in the world. Every object has a transform and is made up of those specific things. Transformations are anything done to the transform, you are doing transformations to the transform. Also if somebody says the transform, they are talking about the object, and if they say transformation. They mean what transformation will be done to the transform, scale, position, or rotation.

28:00 – To move an object around you can do three things. You can click the translation tool, it’s basically a cross with four arrows. Then click one of the axis on the object and drag with the scroll on the mouse. And you could just manually put in the coordinates in the transform box of the object. Or if you hover the mouse above X, Y, or Z and left click and drag with the mouse. All three of these ways you can use to move the object.

29:45 – Rotation works similar to translation tool wise, you can toggle the rotation button instead of the translation button or manually put it in. Rotation is a transformation that rotates the transform of the object. Rotation rotates the transform, or object around the axis you have selected, x, y , or z.

32:08 – Scale also has the same, but different tools to change it. You can toggle the scale button and drag the object with the X, Y, or Z axis, manually put in the scale, or drag after hovering and left clicking X, Y , or Z in the transform panel. Also if you go negative it basically just inverses them. So try to stay in the positive.

35:30 – If you do a rotation it will change the position of the X, Y, and Z axis. It is now a local coordinate grid. For example, if you rotate around the X axis, then the Y axis will now be pointed in a different direction. It is no longer on the world coordinate grid, it is now a local coordinate grid. Kind of hard to explain, if that makes any sense. – To add to that, rotation and scale effect the position. Unless you are doing it on purpose, try to move the position first then change the scale and rotation.

38:00 – If you “nest” an object by dragging it and dropping it into another asset in the hierarchy. It no longer follows the world coordinate grid, but now follows the local coordinate grid of the object it was nested under. And if you rotate the object that the other object is nested under, then it will change along with it. If its local coordinate was -4 on the X axis based on the local coordinate system of the object it is nested under. Then all transformations you do to the object, will change the objects nested under it, it will stay as -4 on the X axis.

44:00 – The number of times you can nest an object under another object is unlimited. You can also nest an object under an object that is nest under an object, and so on. If you do this, then the object will move with the object that is moving with another object, you can do very advanced transformations this way. But don’t get confused when objects aren’t moving how they should, there is a chance it is nested under an object.

 

Unity – manual: Game Objects

Objects are like empty containers, you add components to make what ever it is you are creating. A tree, light post, whatever, you add different components to make that object what it is. Without components, objects are literally nothing, they do nothing, you can’t see it.

 

Unity – Scripting API: Game Objects

A list of variables, constructors, public functions, static functions, and inherited members. And what all of them do, for example, if you use – public static GameObject Find(string name); – then you can input the name of the object and it will basically find it for you and return it, but it must be an active object.

 

Leave a Reply

Your email address will not be published. Required fields are marked *