Professional Documents
Culture Documents
Aim:
1. How to call the various functions and libraries, which are pre-build in unity? Basic
implement.
2. Environment Design and world building (Background Design, terrain painting)
Procedure:
1.
• Create a new 3d project
• For a player movement script, the code is as follows:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// REFERENCES
private CharacterController controller;
{
isGrounded = Physics.CheckSphere(transform.position,
groundCheckDistance, groundMask);
if(isGrounded)
{
if (moveDirection != Vector3.zero &&
!Input.GetKey(KeyCode.LeftShift) )
{
// Walk
Walk();
}
else if(moveDirection != Vector3.zero &&
Input.GetKey(KeyCode.LeftShift) )
{
// Run
Run();
}
else if(moveDirection == Vector3.zero)
{
// Idle
Idle();
}
moveDirection *= moveSpeed;
if(Input.GetKeyDown(KeyCode.Space))
{
Jump();
}
}
controller.Move(moveDirection * Time.deltaTime);
controller.Move(velocity * Time.deltaTime);
Parijat Niyogy Lab Assessment 3 19BCE0696
}
Parijat Niyogy Lab Assessment 3 19BCE0696
2.
• Create a 3D project.
• Import assets for grass, trees and terrain materials.
• In the Project Hierarchy, create a terrain.
• In the Inspector section, click on paint terrain.
• Click on ‘Raise and Lower Terrain’ and then select the various brushes to edit the
terrain, by raising and lowering portions of it.
• Change the brush size and opacity accordingly.
• Select ‘Paint Texture’ and import the layers by pressing ‘add layer’
• After this paint the terrain accordingly
• Create pathways with different terrains.
• Add trees by selecting the ‘Paint Trees’ option.
• Import the assets and add different trees.
• Add a suitable sky of choice
Parijat Niyogy Lab Assessment 3 19BCE0696
Result:
Therefore, the Libraries and Functions prebuilt in Unity has been utilized as well as the
environment design and painting of textures have been implemented.
Conclusion:
Built-in functions are important throughout game development. Game Engines
provide the use of several built-in functions and libraries to make game development a
smooth process. They are also fine tuned to consume the least execution time possible and
occupy very less space. There are optimized and better built than user defined functions.
Environment design is vital to any dimensional game of any genre. This helps the
player have an interesting experience and helps the players throughout the game.