⭐ FixedUpdate(): ☑️ Recap: Update used to determine the state of a game object in the next frame and thereon continuously ☑️ Called continuously after 0.02 seconds or whatever time interval that you choose. Unity’s fixed timestep defaults to 0.02. This means FixedUpdate() is being called after every 0.02 seconds ☑️ Tied in to the physics engine. Contains physics based updates ☑️ This method is
Introduction to C# in Unity3D #1: 💻What? Why? How
💻It is an object-oriented programming language created by Microsoft 💻 Object-oriented programming (OOP) is about creating objects that contain both data and methods. 💻It is easy to learn and simple to use 💻 Good community Support 💻Good for making games, VR apps, AR apps, Your C# code will interface with the game engine via the Unity3D Scripting API. The Unity3D scripting API exposes functions that
Unity3D Scripting API #4 : Update() ☑️
⭐ Update(): ☑️ This method is called continuously every frame ☑️ The Update() method is good for receiving inputs from the user continuously. Anything that needs to change or be adjusted regularly will be written inside the Update() method for example⏱️ Timers. ☑️ Also used for non-physics based movement for example non-physics based character controller in 2D games ☑️ Update() depends on the game’s refresh
Unity3D Scripting API #3 – Start() 🏁
💚MonoBehaviour💚 is the base class from which every Unity script derives. Any Unity3D script that you create will extend from the MonoBehaviour class. The MonoBehaviour class will execute events in a pre-determined order. 🍱Method: A method is a function that performs a specific task. So these methods are performing a specific function. For example whatever code is written inside the Start() will execute on the
Functions as objects
In JavaScript functions are a type of object known as function object. You can work with function objects as though they were objects. Functions may be assigned to objects, passed in as arguments to other functions, returned from other functions. Additionally a function can be passed into an array. And this gets me to earlier in my articles when I’ve stated “almost everything in JavaScript
Getters & Setters in JavaScript – part 2
carrying on from part 1 .. Getters in JavaScript Getters are functions that retrieve a value from static properties from an external source. You can only access properties and cannot access methods as they are functions of an object or class and are not static.There are three ways you can use getters and setters:1. Default method syntax2. get keyword3. Object.defineProperty() method We will now discuss
Setters and Getters in JavaScript – part 1
Accessors: Getters and Setters This is part 1 of a brief introduction to getters and setters in JavaScript. Getters and Setters are ES5 features. Objects have two types of properties: Static data property Accessor property So far we have come across static data properties in the objects that we have been making. For example: let blackLivesMatter = { status: true, usecase: ‘daily’ } In this
The break and continue statements in JavaScript
Break and continue statements The break statement is used to exit a loop completely once a condition has been met, or after x number of iterations. As such it is commonly used within an if conditional block. Take as an example the following code: for (let i = 0; i <= 5; i++){ console.log(i); } This will print out the value of variable i from
Deep and shallow copying in JavaScript – part 2
Copying objects with Shallow copy Now that we went over shallow and deep copies in part 1, let’s go over shallow copying in JavaScript. There are 3 ways to create shallow copies in JavaScript: Iteration using for key in an object Spread operator Object.assign() 1. Iteration using for key in an object In order to copy the items of an object into another object we
Pass by reference vs Pass by Value
Pass by value Non-primitive data types are passed by reference compared to primitive data types that are passed by value. As such non-primitive data types are also called reference types. To understand why they’re called reference types, we need to briefly look at how variables are stored in memory. A fixed amount of memory is allocated to a variable after it is declared. For primitive