Saturday, July 10, 2021

2D And 3D Objects In Unity3D

First view of our project look like below.

If not ! Then you can change your project layout from layout section in window tab.

here my layout is of 2 by 3.


In hierarchy window you can see there are two game object present already. These Game objects are :

i) Camera 

ii) Directional light

Camera 

left hand side we can see the camera, x,y,z axis and camera preview.

Right hand side we can see the inspector window for camera.From inspector window we can change the position, scale, rotation for the camera.

Sometimes we could not see the object presents inside the scene view.To see the object we can change the camera position/Projection /clipping plane near ,far of the camera.

Directional Light

we can add directional light in our game view from the game object tab ->light->directional light. From the inspector window we can change the light , intensity and more for thew directional light.

Okay ! Now we will add a 3D game object in our scene.

Here in unity we have two option to add game object in the scene.

first from the game object tab GameObject->3DObject->select any of the object from the listed objects like cube,sphere,plane,quad etc.

the other option to add 3D game object is quite simple just right click in hierarchy window select 3DObject and then choose any of the object from the list,see below.


 

After adding the cube 3D Object we can see a cube inside the game scene and inspector window for the cube from which we can change the cube properties.

For axis simply understand this:

X is for LEFT and RIGHT

Y is green on , for UP and DOWN 

Z is for FORWARD and BACKWARD

Here  we can see mesh filter and mesh renderer as component of cube.Mesh Renderer is for rendering the mesh like cube , sphere,Capsule, cylinder etc even we can download meshes from the asset store as well and can use it.

If in the Game  lighting is not proper then go to window tab -> lighting settings -> and Check auto Generate(Generate lighting).

Similarly  we can add other game object like sphere , cylinder , capsule etc in side the scene. 

0 Comments:

Post a Comment

Thank you for your comment !