c#

Difference Between Destroy and DestroyImmediate Unity Functions

Objective : Objective of this Tutorial is to understand diffence between Destroy and DestroyImmediate unity function Purpose of both function is same, to destoy gameobject, but there is very small difference, which is very crucial to understand, wrong use of these function can cause your app to crash So first of all little bit of theory and then some code Destroy() :  This just destroy the game object passed as parameter.  It set all the references to that game object to null at the end of frame. Syntax: Destroy(myGameObject); Let see it in code: Create new script and add this code and add it to Main Camera and click play, and just left click to create new game object and press space bar to destroy the game object and check the log in console window you will notice that first log print the status “true“, and second log print the name of currObject which…

unity

Difference Between Update and FixedUpdate

Objective : The objective of this post to understand the difference between Update and FixedUpdate unity function, and their uses. Update : Update is called once per frame, so if the game is running at 24 fps, then this will be called 24 times in a second. As we know game never run at constant frame rate because of several reason, so update will not be called on a regular timeline, means the time between update calls may be different. Uses: Update is used for moving non physics objects. Update is used for receiving Input. Update is used for simple timer. Fixed Update: As it name suggests this will be called after fixed time duration, so time duration between two consecutive calls is always same unlike of Update where this may vary.  Uses : This is commonly used for performing physics related task, like applying force on rigidbody. Now let’s see this in example Create a…

c#

Unity Interview Questions

In this, I am going to list some of the very commonly asked interview questions for unity developer profile. Unity Engine Specific Question : Difference between Update,Fixed Update and Late Update. What is Prefabs in Unity 3D? What is the use of AssetBundle in Unity? What is difference between Resources and StreamingAssets Folder. What is Batching and what is the use of Batching? Difference between Destroy and DestroyImmediate unity function Difference between Start and Awake Unity Events What is the use of deltatime? Is this possible to collide two mesh collider,if yes then How? Difference between Static and Dynamic Batching. What is the use of Occlusion Culling? How can you call C# from Javascript, and vice versa? Arrange the event functions listed below in the order in which they will be invoked when an application is closed: Update() OnGUI() Awake() OnDisable() Start() LateUpdate() OnEnable() OnApplicationQuit() OnDestroy() C# related Questions :  Difference between…

Google Cardboard

How to Build Google Cardboard VR Game using Unity part -1

Unity made it very easy to create VR apps, and with cardboard, it is just super easy. Unity 5.1 onwards contains built-in support for certain VR devices, but for that, you require Unity pro licence.   So Why Cardboard ? Because it is cheapest VR Device available in the market. it cost you only $10- $20, and you do not need Unity pro licence for that. other options for virtual reality devices                                          all are very expensive and some are not easily available to the user. On the other hand google Cardboard works with most modern Android phones and iPhone. Phones need to be running Android 4.1 (Jelly Bean) or above. Ideally should have a gyroscope, most important there are tons of apps available. Prerequisites Unity – At least v5.1 is…