Unity Tips Use rich text in console output like a pro In Unity, the console is the most important place where we debug and output variables or objects. Here is an example of the console output in Unity: Is there anyway HackingWithUnity 20 Mar 2023 · 1 min read
Unity Basic Camera following in Unity Let the camera follow the character's movement in Game is quite often to see in games, such as Super Mario. Luckily Unity make it quite easy to implement by making HackingWithUnity 1 Mar 2023 · 1 min read
Shader Rendering pipeline in Shader The rendering pipeline, also named the graphics pipeline, is a series of stages that a graphics assets goes through to render an image on the user's screen. The reason why HackingWithUnity 28 Feb 2023 · 2 min read
CG/HLSL Data Types in Shader In the article Introduction to Shader in Unity 2023, we already saw how to define a variable in Properties, and which provides a way we can adjust values on the HackingWithUnity 27 Feb 2023 · 2 min read
Shader Data Types As mentioned in the Introduction to Shader in Unity, Unity provides tons of the Shader data types which can use to create fantastic visual effects. Here are more details on HackingWithUnity 26 Feb 2023 · 3 min read
SubShader in Unity As mentioned in the Introduction to Shader in Unity, we all know that a Shader must contain at least one SubShader, and maybe more than one SubShaders, which is the HackingWithUnity 24 Feb 2023 · 3 min read
Introduction to Shader in Unity Many of us have heard or even used Shader in the Unity game, so in the next coming few weeks, we will go through few hot topics on the Shader. HackingWithUnity 23 Feb 2023 · 5 min read
C# How to auto destroy a game object after a few seconds in Unity Image we have a gameobject with a script SelfExplode attached to it. We want this specific gameobject explode with 60 seconds after spawn. Full script: using System.Collections; using System. HackingWithUnity 21 Feb 2023 · 1 min read
Unity Basic Import 2D Sprites in Unity Suppose we have a bunch of 2D resources, such as idle, run, and so on, and we want to import that in our 2D game with animation, here are few HackingWithUnity 19 Feb 2023 · 2 min read
Unity Tips GameManager Template in Unity Many game developer are using GameManager to manage the game status, do initialization and more in their games. So it is recommend for anyone who wants to have the same HackingWithUnity 18 Feb 2023 · 1 min read
Unity Basic [System.Serializable] in Unity [System.Serializable] is a C# attribute that can be applied to a class, struct, or field to indicate that it can be serialized by Unity's serialization system. By doing which HackingWithUnity 17 Feb 2023 · 1 min read
Unity Tips How to refer child game objects' instance in Unity Image you have a grouped objects in the hierarchy, Game object 1 has child game objects 1_0, 1_1 and 1_2 as following: So how do we get HackingWithUnity 16 Feb 2023 · 1 min read
Unity Basic Turn JSON string into Custom objects in Unity Store user's data or game's state in JSON, or fetch data from api call in game, Luckily, Unity does provide the JsonUtility to rescue, which can easily convert a json HackingWithUnity 16 Feb 2023 · 1 min read
Unity Basic Check user's IP address in Unity Although Unity does not provide a way on checking user's ip directly, still we can make a script to achieve that: using System.Collections; using System.Collections.Generic; using UnityEngine; HackingWithUnity 15 Feb 2023 · 1 min read
Unity Basic What is the difference between GameObject.FindObjectOfType and GetComponent In Unity, it is quite often to get a GameObject's component, such RigidBody or collision2D. There are a couple of ways of doing so, and GameObject.FindObjectOfType<>() ,GetComponent<>() are both HackingWithUnity 14 Feb 2023 · 1 min read
Unity Basic Canvas Render Mode in Unity Canvas is a key component of UI in Unity and Canvas render mode is the key of showing the canvas properly. There are 3 render modes at the moment in HackingWithUnity 13 Feb 2023 · 2 min read
Unity Tips How to prevent colliders from passing through each other Collisions with fast-moving objects are always a problem. A good way to ensure that you detect all collisions is to use Raycasting instead of relying on a physics simulation. This HackingWithUnity 22 Mar 2021 · 1 min read
Unity Tips Mouse Click or Finger tap only on either game objects or UI objects When facing the situation that we want the mouse click and finger tap can happened only on either game objects or UI items. Here is how: using UnityEngine.EventSystems; private HackingWithUnity 15 Mar 2021 · 1 min read