Featured
-
How to create scrollbars in Unity3D
Scrollbar in Unity3D Scroll bars let a user cho
by inder.singh
Tags
Camera Projections in Unity
The camera view can be either set to perspective or orthographic.
You can change this by going to the camera settings as shown in the image below :-
1. Perspective Camera : In this the closest things seems bigger. In gaming it r...
Set RectTransform Right, Left, Top and Bottom value via script
One can easily change RectTransform right,left,top and bottom value using script in this way :-
object.GetComponent<RectTransform> ().offsetMin = new Vector2 (0,-1);//left-bottom
here "0" indicates Left value and "-1&...
How can the gameobjects in unity be moved back and forth linearly
If you want to move gameobjects back and forth in unity than you can do this by using a function Mathf.PingPong. This function takes two float
values we can say 'q' and 'length'. It will ping-pong the value 'q' so t...
Rendering Modes of Canvas
Canvas is a game object where all the UI elements are children of it. It has a canvas component attached to it. All UI elements can only be visible inside a canvas. If you directly create an Image then Canvas will be created automatically w...
How to find Gameobjects in Unity
In unity you can find gameobjects by their name or tag.
1. Find objects by Name:- You can easily find the gameobjects by their names.
Here is the simple code for this
Gameobject Abc;
void Start()
{
Abc = GameObject.Find("Square");...
Unity 3D Materials
In Unity, Material is an asset that act like a container for shaders and textures that can be applied to models.
Models cannot be rendered without a material. It plays an important role in defining how your object will appear.
In or...
Use of Linear Interpolation in Unity
Linear interpolation simply means finding a value in between two given values, 'Lerp' is the function used for this. It will linearly interpolates
between the two given values.
Lerp can be used for following different types:-
1. Ve...
Rigidbody in Unity
Rigidbody means the object will be controlled by physics. If you add this component to your object then it will be totally controlled by physics engine of unity. If you want to detect collisions to your objects then you have to add rigidbod...
move an object
When we are developing games then sometime we need an object which generate from a position and move by itself in a particular direction. So here is the simple code from which yo u can do this.
You just make your object a prefab and add a scri...
Animation effect to object through script
Add a animation effect to your game object through simple line code in unity
Add this line to your script update funtion and the object in which this script is added will show you a rotating animation at its position
void Update () {
...
Camera follow player
Add a new script to Main Camera of your scene.
public class CameraController : MonoBehaviour
{
public GameObject player; // add your player object in the tool
private Vector3 offset;
void Start ()
...
using audio data in unity 5
1. On format and loading type
Audio files imported in unity 5 are by default set to be preloaded i.e. audio clip will be loaded at the moment when game is being loaded.
This can cause game to take much time to load if audio files are heav...
SQLite3 with Unity5 : Connectivity
First you have to add an extension (named.. SQLite Manager) in the Mozilla Firefox browser. (It is simply for managing database in some cases).
Then you need three .dll files (known as ASSEMBLIES)..., (these files are simply PLUGINS for SQLite...
Difference between Start() and Awake() in Unity3d
Here is an small intro of unity initialisation function name start and Awake.
Start
Start function is called only if the script component is enabled.
Start and Awake both are only called once in a lifetime.
Start function is called up aft...
Trigger Colliders
Hello Find Nerd Readers,
While making even the simplest game you have to use triggers and collisions. In this blog we are targeting Triggers.
Q1: What are Triggers?
Ans: Triggers in Unity are Collider which does not reflect any ph...
OnTriggerEnter in unity
OnTriggerEnter
Hello Find Nerd Readers,
While making even the simplest game you have to use triggers and collisions. In this blog we are targeting Triggers.
Q1: What are Triggers?
Ans: Triggers in Unity are Collider w...
How to get mouse swipe input in Unity 3D?
Moving objects on Mouse swipe is a very interesting way of getting user input , it is very different from traditional
approach of getting input from keyboard keys . It provids user with unique experience and makes user part of the game.
Belo...
Moving objects by changing its Transform
Transform are used for storing and manipulating objects Position , Rotation and Scale or Size .
In this blog we will use transform to move an object.Moving an object by changing its transform does not require a Rigidbody, that way its hard to...
How to save data in SQLite in Unity3d
To start up with CURD(Create,Update,Read,Delete) operations in unity3D using SQLite.
You need to follow few steps:
Steps for installing and use sqlite browser:
1.You need to have an SQLite Browser installed in your system:
Which you can ...
Rigidbody2D in Unity3D
Unity built in physics engine provide components that handle physical simulation.
Rigidbody2D is one of the main component among the unity physics engine that allow
sprite to be moved in a physically convincing way by applying forces from the ...
Sorting Layers in Unity2d
When building a 2D game in Unity3D. We need to specify which items will be rendered above which item.
We can do it by specifying the distance of the sprite from the camera but Unity provides a better way of doing this through the use of Sorting ...
Collider 2D in Unity 3D
Collider 2D in Unity 3D
Unity has two physics engines, one for 3D and one for 2D. When we use 2D physics engine a collider 2D component must be used. There are four collider 2D component. Each collider 2D component is optimesed for a particula...
Hinge joint and Fixed joint in Unity3D
Hinge Joint in Unity3D
The hinge joint in unity is basically used to connect two rigid bodies. When there is a need to constraint the movement of an object
then we require to add hinge joint on it.
For eg - Door,Pendulum.
In this we rest...
Pros and Cons of Unity3D
Pro's:
User-Friendly Interface, very easy to learn for beginners.
Supports multiple development platforms , mobile, desktop, web and console.
Deployment to multiple platforms is very easy to manage.
Unity has its Asset store where you can...
Accelerometer in unity
Accelerometer in unity means to take input from a device by tilting it along x-axis and y-axis and after taking the input transform the object accordingly. To achieve this we need to write few lines of code within update method. So that the input...
Chapter 3: Rotate a object about its axis using force in unity 4 /5
Unity 5 comes with the advancement and new approach. In Unity 5 there is no need to set physics manually but you do need to set max angular velocity of the object through coding individually . By doing this you can set max angular velocity to se...
Chapter 2: Rotate a object about its axis using force in unity 4 /5
In unity physics plays a very important role .So to make the object rotate real and affected by force. We have to set the physics of unity 4 engine manually.If you are using unity 5 then things goes someway different.
Unity 4 Users:
To ach...
Chapter 1: Rotate a object about its axis using force in unity 4 /5
As we give force to any rigid body to move in any direction i.e.,
rigidbody .AddForce(Vector 3.fwd/down/left/right/up , ForceMode);
Similarly if you want to rotate a object forcefully about its axis we can use:
rigidbody .AddTorque...
Make a Real Mirror in Unity 3D
Make a Real Mirror in Unity 3D :
Create any scene in Unity like this -
Add two cameras to the scene, first one (SceneCamera) is able to see the whole scene and second one (MirrorCamera) is able to see the part of the scene which we want t...
Getting Mouse Click Event form a 3d GameObject in Unity
We get a click event when we click a Button in UI , but how to get a click event while clicking on
a GameObject from our scene .
It is very simple .
To get a click event from a object , add a collider to that obje...
Unity 5.1 UI: DropDown Menu
Unity 5.1 UI : DropDown Menu
We have to go through the following steps to create a DropDown menu in Unity 5.1 UI -
In the Hierarchy Window go through UI -> Canvas
Create a Panel1 as a child of this canvas
Create a Button1 as a child of ...
Sprite Editor in Unity 5.1
Sprite Editor in Unity 5.1
The Sprite Editor is used to slice individual sprites from Sprite Sheet.
When Sprite mode 'multiple' is selected the sprite editor button appears on the Inspector window. Click the Sprite Editor button to open t...
Namespaces in Unity 3D
Namespaces in Unity 3D :
Namespaces are container of the classes. Namespaces help us to organize the scripts. When we create a new C# script in Monodevelop, two namespaces are included at the top, these are ' using UnityEngine; ' and ' using S...
Full List of Key Concepts of Unreal Engine 5 and Unity
Key concepts of Unreal Engine 5 and Unity : There are various important concepts associated with the Unreal Engine 5 and Unity which are extremely beneficial for a gaming app developer. We all should be aware of these key content so that dur...
Events in Unity 3D
Loading Levels, Play,Pause and Exit in Unity 3D scene :
Example :
btn is a string.
void OnClick ()
{
if(btn=="Play")
{
Application.LoadLevel("MyScene");
}
}
Play a Game :
Time.timeScale=1;
Pause a Game :
Time.timeScale=...
Colliders, Rigidbody, Prefabs and Tags
Introduction of Colliders, Rigidbody, Prefabs and Tags.
How they all are used in unity3D
A* PathFinding Algorithm
A* PathFinding algorithm is best algorithm to find the path between the player and target.
Easy and powerful to use.
How to Restore Work When Unity3d gets Crashed?
Unity can crash due to a lot of reasons. This problem is faced by many Unity3D developers, when Unity3D crashes due to whatever reason a lot of work if unsaved gets lost, sometimes the whole scene gets corrupted. This affects our work and wastes ...
Pausing the Game through Coding in Unity3D
You can pause your game in Unity3D by changing the rate at which the time is passing. It is very helpful in making pause menu in the game and in various situations that require pausing of all the events and physics to stop at the moment.
To pa...
How to Move Make Objects by Adding Force in Unity
There are two methods to make object move in unity:
By changing its Transform (Position).
By adding Force by using AddForce() method.
In this blog I have mentioned, how we can make object move by adding force.
Force and Velocity both ...
IEnumerator
What is IEnumerators ?
IEnumerators are used to allow a program to yield things like the WaitForSeconds function, which tells the script to wait without hogging the CPU.
StartCoRoutine essentially runs a function in another thread when used...
GUI in Unity
GUI in Unity 3D is an interface for issuing commands to a computer utilizing device.
The GUI class is the interface for Unity's GUI.
There are many static functions used in the GUI.
BeginGroup : It must be closed with the EndGroup.
Bo...
Positioning of MainCamera Scene View
Positioning a camera to desired position in Unity3D is a very time consuming and hectic task in itself. But there is a way you can achieve that and save a lot of time.
So, firstly you can get your shot where you want to be in Scene View, by movi...
Difference Between OnCollisionEnter () and OnTriggerEnter()
OnCollisionEnter () and OnTriggerEnter() both are the methods of the Collider Class. Both are used to detect collisions when colliders enter the collision but both perform differently and cause different events.
OnCollisionenter() is used to c...
Benefits of Unity3D
Advantage of Unity
As the name UNITY means bringing everything together, the same is done by the Unity Game Development IDE. Unity brings all the aspects of game development under one roof and that roof is called Unity IDE.
I am completely...
Advantages Of Unity
Advantages Of Unity3D
Unity Has number of advantages, Some of them are here:-
Supports Multi Platform
Unity supports development of games in Multi Platform (iOS, Android, Windows, Web, PS3, and Xbox) without separate code. Unity allows c...
Advantages of Unity3D
Why Unity3D:-
In the world of gaming, We have different game engines to build a game.
Every engine has its advantages and dis-advantages.
Some of them are good because they are open source, some of them are good because they have powerfu...
Creating a Terrain in Unity - Part 1 (Beginner)
A brief introduction of Unity 3D
Unity is a cross-platform game engine which is used to make 2D and 3D games for mobile devices, web browsers, consoles and desktops.
There are many useful features in Unity which includes Particles, Physics, S...
Upload Screen Shot to server
Most of the apps or games allowed to the user to upload his screen shorts on the server for latter user.
Today I am going to show how to upload screen shot to server in Unity3D.
private string url = "www.mysiteURL";
Texture2D screenShot ...