<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Sivakumar Prasanth</title>
    <description>The latest articles on Forem by Sivakumar Prasanth (@prasanth_sivakumar).</description>
    <link>https://forem.com/prasanth_sivakumar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2033887%2F088e87da-4959-4e37-8beb-5394436d21c8.jpg</url>
      <title>Forem: Sivakumar Prasanth</title>
      <link>https://forem.com/prasanth_sivakumar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/prasanth_sivakumar"/>
    <language>en</language>
    <item>
      <title>Sliding Window: Intermediate</title>
      <dc:creator>Sivakumar Prasanth</dc:creator>
      <pubDate>Sun, 01 Mar 2026 15:51:36 +0000</pubDate>
      <link>https://forem.com/prasanth_sivakumar/sliding-window-intermediate-5bag</link>
      <guid>https://forem.com/prasanth_sivakumar/sliding-window-intermediate-5bag</guid>
      <description>&lt;p&gt;Welcome to my algorithmic journey!&lt;/p&gt;

&lt;p&gt;If you've ever looked at a coding challenge and felt like you were staring at a brick wall, you aren't alone. Most of the time, the secret isn't about being a math genius, it's about recognising the pattern.&lt;/p&gt;

&lt;p&gt;In this series, we are breaking down the most essential coding patterns from beginner to expert level, keeping things simple, practical, and (hopefully) a little bit fun.&lt;/p&gt;

&lt;p&gt;Today, we are diving deep into Sliding Window Technique. Whether you are preparing for a big interview or just trying to write cleaner, faster code, mastering this pattern is a total game-changer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9g8ar0wmttn2vf82alvi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9g8ar0wmttn2vf82alvi.png" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's strip away the jargon and see how it actually works!&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Sliding Window?
&lt;/h2&gt;

&lt;p&gt;Imagine you have a long, delicious Subway sandwich (our array), and you're trying to find the 3-inch section with the most olives. Instead of cutting a 3-inch piece, measuring the olives, throwing it away, and then cutting another 3-inch piece from scratch, you simply slide a 3-inch magnifying glass along the sandwich. As the glass moves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It welcomes a new olive on the right.&lt;/li&gt;
&lt;li&gt;It says goodbye to an old olive on the left.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;In the world of coding, a Sliding Window is a technique used to perform operations on a specific "subset" of data (like a subarray or a substring) without re-calculating everything from zero.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Mathematical Logic
&lt;/h2&gt;

&lt;p&gt;In a standard "Brute Force" approach, if you want to find the sum of every 3-item window in an array, you'd do this: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sum items 1, 2, and 3. &lt;/li&gt;
&lt;li&gt;Forget everything. &lt;/li&gt;
&lt;li&gt;Sum items 2, 3, and 4. &lt;/li&gt;
&lt;li&gt;Forget everything. &lt;/li&gt;
&lt;li&gt;Sum items 3, 4, and 5… &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is a lot of wasted energy! The Sliding Window logic says: "Hey, items 2 and 3 were in both windows. Why calculate them again?"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The "Add &amp;amp; Subtract" Trick&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Mathematically, the logic is as simple as a revolving door at a mall. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Entry: A new element joins the window from the right (+). &lt;/li&gt;
&lt;li&gt;The Exit: The oldest element leaves the window from the left (-).&lt;/li&gt;
&lt;li&gt;The Middle: Everything else stays exactly where it is!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If we are looking for the sum of a window (W), and we move from position i to i+1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NewSum = OldSum - ElementAt(i) + ElementAt(i + WindowSize)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Efficiency and Complexity
&lt;/h2&gt;

&lt;p&gt;Before we break down the performance of this algorithm, it's important to understand how we measure "speed" and "memory" in the coding world. We use something called Big-O Notation. If you aren't familiar with terms like O(n) or O(1), or if you just need a quick refresher so you don't get lost in the numbers, check out my previous guide &lt;a href="https://dev.to/prasanth_sivakumar/how-algorithms-scale-with-input-size-breaking-down-big-o-3np2"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it solves Time Complexity&lt;/strong&gt;&lt;br&gt;
In a typical "Brute Force" approach (the loop-inside-a-loop nightmare), the time complexity is usually O(N x K), where N is the total number of items and K is the size of your window. If both are large, your program slows down to a crawl. With the Sliding Window, we achieve the holy grail of performance: O(N).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it solves Space Complexity&lt;/strong&gt;&lt;br&gt;
Most Sliding Window problems have a Space Complexity of O(1) (Constant Space). &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why&lt;/strong&gt;? Because you aren't creating a new array for every window. You are just keeping track of a few variables (like current_sum, max_length, or two pointers called left and right).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Exception&lt;/strong&gt;: If you're using a Hash Map or a Frequency Table to keep track of characters (like in the "Longest Substring with Unique Characters" problem), your space might grow to O(K), where K is the size of your character set. But even then, it's usually much smaller than the original data!&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Where is it used? (Applications)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Video Streaming (The "Buffer" Window)&lt;/strong&gt;: Ever notice how YouTube or Netflix loads a little bit of the video ahead of where you are? That's a sliding window! The Window: The 30 seconds of video currently being downloaded. The Slide: As you watch one second, the window "slides" forward to download the next second. It keeps a constant "window" of data ready so your movie doesn't lag.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Network Congestion (TCP/IP)&lt;/strong&gt;: The internet is basically a giant series of tubes. If a computer sends too much data at once, the tubes clog. To fix this, the internet uses a "Sliding Window Protocol." It sends a specific number of packets (the window). It only "slides" to send the next packet once the receiver says, "Got it!" This prevents your Wi-Fi from having a total meltdown.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Health &amp;amp; Fitness Tracking&lt;/strong&gt;: If your Fitbit or Apple Watch tells you your "Moving Average Heart Rate," it's using this technique. Instead of showing your heart rate from 3 hours ago, it calculates the average of just the last 5 minutes. Every minute that passes, it drops the oldest minute and adds the newest one. This gives you a smooth, real-time update.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Classic Interview Problems
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;You are given an array and asked to find the highest total you can get by adding up exactly K numbers in a row. This is the "Hello World" of the Fixed Sliding Window.&lt;/p&gt;

&lt;p&gt;You are given a string and asked to find the longest part of it that contains only a specific number of unique letters. This is the "Accordion" of Sliding Window, where your window grows and shrinks based on what it finds.&lt;/p&gt;

&lt;p&gt;You are given two strings and asked to find the shortest possible "slice" of the first string that has every letter of the second string inside it. This is the "Final Boss" that teaches you how to perfectly balance expanding and contracting your window.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;p&gt;Now, let's see this pattern in action!&lt;/p&gt;

&lt;p&gt;For these demonstrations, I'll be using C#. However, don't let the language choice stop you if you usually code in Python, Java, JavaScript etc. The logic and the underlying pattern remain exactly the same across all languages, only the syntax changes. Feel free to follow along and implement the logic in your own preferred language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fixed Size Sliding Window:&lt;/strong&gt;&lt;br&gt;
The general steps to solve these questions by following below steps: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Find the size of the window required, say K. &lt;/li&gt;
&lt;li&gt;Compute the result for 1st window, i.e. include the first K elements of the data structure. &lt;/li&gt;
&lt;li&gt;Then use a loop to slide the window by 1 and keep computing the result window by window.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ex&lt;/strong&gt;: You are given an array representing the hourly electricity usage (in kilowatts) of a small neighborhood over a 24-hour period. Find the maximum total energy consumed during any continuous 3-hour "Peak Period.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class HelloWorld
{
    private static int GetMaxTotalEnergy(int[] array, int subArraySize){
        // Invalid
        if(array.Length &amp;lt; subArraySize) return -1;

        int currentSum = 0;

        // First window sum
        for(int i = 0; i &amp;lt; subArraySize; i++){
            currentSum += array[i];
        }

        int maxSum = currentSum;

        int arrayLength = array.Length - subArraySize + 1;

        for(int i = 1; i &amp;lt; arrayLength; i++){
            currentSum += array[i + subArraySize - 1] - array[i - 1];

            maxSum = Math.Max(maxSum, currentSum);
        }

        return maxSum;
    }

    public static void Main(string[] args)
    {
        int[] myArray = {4, 2, 10, 8, 7, 6, 3, 2, 1, 5};
        int k = 3;

        Console.WriteLine("Maximum total energy of a subarray of size " + k + " is: " + GetMaxTotalEnergy(myArray, k));
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Variable Size Sliding Window:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The general steps to solve these questions by following below steps: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We increase our right pointer one by one till our condition is true. &lt;/li&gt;
&lt;li&gt;At any step if our condition does not match, we shrink the size of our window by increasing left pointer. &lt;/li&gt;
&lt;li&gt;Again, when our condition satisfies, we start increasing the right pointer and follow step 1. &lt;/li&gt;
&lt;li&gt;We follow these steps until we reach to the end of the array.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ex&lt;/strong&gt;: Given an array of positive integers and a target sum, find the length of the smallest contiguous subarray whose sum is greater than or equal to that target. If no such subarray exists, return 0.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class HelloWorld
{
    private static int GetSmallestSubarray(int[] array, int target) 
    {
        int left = 0;
        int currentSum = 0;
        int minLength = int.MaxValue;

        for (int right = 0; right &amp;lt; array.Length; right++) 
        {
            currentSum += array[right];

            while (currentSum &amp;gt;= target) 
            {
                int currentWindowSize = right - left + 1;
                minLength = Math.Min(minLength, currentWindowSize);

                currentSum -= array[left];
                left++; 
            }
        }

        return minLength == int.MaxValue ? 0 : minLength;
    }

    public static void Main(string[] args) 
    {
        int[] numbers = { 1, 2, 3, 4, 5 };
        int targetSum = 7;

        Console.WriteLine("Smallest subarray length: " + GetSmallestSubarray(numbers, targetSum));
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Practice Roadmap
&lt;/h2&gt;

&lt;p&gt;Theory is great, but coding is a sport. You only get better by practicing! To help you master this pattern, I've curated a list of LeetCode problems. To get the most out of your study time, I recommend following the 3:6:1 ratio (or the 3:5:2 if you're feeling brave!):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;30% Easy&lt;/strong&gt; to build your confidence and grasp the core logic.&lt;br&gt;
&lt;a href="https://leetcode.com/problems/maximum-average-subarray-i" rel="noopener noreferrer"&gt;https://leetcode.com/problems/maximum-average-subarray-i&lt;/a&gt;&lt;br&gt;
&lt;a href="https://leetcode.com/problems/substrings-of-size-three-with-distinct-characters/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/substrings-of-size-three-with-distinct-characters/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://leetcode.com/problems/contains-duplicate-ii/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/contains-duplicate-ii/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;60% Medium&lt;/strong&gt; to learn how to apply the pattern in tricky scenarios.&lt;br&gt;
&lt;a href="https://leetcode.com/problems/longest-substring-without-repeating-characters" rel="noopener noreferrer"&gt;https://leetcode.com/problems/longest-substring-without-repeating-characters&lt;/a&gt;&lt;br&gt;
&lt;a href="https://leetcode.com/problems/max-consecutive-ones-iii" rel="noopener noreferrer"&gt;https://leetcode.com/problems/max-consecutive-ones-iii&lt;/a&gt;&lt;br&gt;
&lt;a href="https://leetcode.com/problems/minimum-size-subarray-sum" rel="noopener noreferrer"&gt;https://leetcode.com/problems/minimum-size-subarray-sum&lt;/a&gt;&lt;br&gt;
&lt;a href="https://leetcode.com/problems/find-all-anagrams-in-a-string" rel="noopener noreferrer"&gt;https://leetcode.com/problems/find-all-anagrams-in-a-string&lt;/a&gt;&lt;br&gt;
&lt;a href="https://leetcode.com/problems/fruit-into-baskets/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/fruit-into-baskets/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10% Hard&lt;/strong&gt; to challenge your limits and see the pattern at its peak.&lt;br&gt;
&lt;a href="https://leetcode.com/problems/minimum-window-substring/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/minimum-window-substring/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://leetcode.com/problems/sliding-window-maximum/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/sliding-window-maximum/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Don't get discouraged if you get stuck! The goal isn't to solve it in five minutes; the goal is to recognise the pattern. Happy coding!&lt;/p&gt;




&lt;p&gt;Stay updated with the latest insights and tutorials by following me on &lt;a href="https://sivakumar-prasanth.medium.com/" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;, &lt;a href="https://dev.to/prasanth_sivakumar"&gt;dev.io&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/prasanthse1996/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. For any inquiries for games or questions, feel free to reach out to me via &lt;a href="mailto:prasanth15sp@gmail.com"&gt;email&lt;/a&gt;. I'm here to assist you with any queries you may have!&lt;/p&gt;

&lt;p&gt;Don't miss out on future articles and tips!&lt;/p&gt;

</description>
      <category>slidingwindow</category>
      <category>slidingwindowalgorithm</category>
      <category>algorithms</category>
      <category>programming</category>
    </item>
    <item>
      <title>Prefix Sum: Beginner</title>
      <dc:creator>Sivakumar Prasanth</dc:creator>
      <pubDate>Wed, 25 Feb 2026 02:18:28 +0000</pubDate>
      <link>https://forem.com/prasanth_sivakumar/prefix-sum-beginner-4k13</link>
      <guid>https://forem.com/prasanth_sivakumar/prefix-sum-beginner-4k13</guid>
      <description>&lt;p&gt;Welcome to my algorithmic journey! If you’ve ever looked at a coding challenge and felt like you were staring at a brick wall, you aren’t alone. Most of the time, the secret isn’t about being a math genius, it’s about recognising the pattern. &lt;/p&gt;

&lt;p&gt;In this series, we are breaking down the most essential coding patterns from beginner to expert level, keeping things simple, practical, and (hopefully) a little bit fun. &lt;/p&gt;

&lt;p&gt;Today, we are diving deep into Prefix Sum.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fem8zftu1ynqneb23be3j.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fem8zftu1ynqneb23be3j.webp" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Whether you are preparing for a big interview or just trying to write cleaner, faster code, mastering this pattern is a total game-changer. &lt;/p&gt;

&lt;p&gt;Let’s strip away the jargon and see how it actually works!&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Prefix Sum?
&lt;/h2&gt;

&lt;p&gt;Imagine you are standing at the start of a long road, and every mile there is a sign telling you how many coins are buried under the ground at that specific spot. If I asked you, “How many coins are there between mile 3 and mile 8?”, you would normally have to walk from 3 to 8 and add them up one by one. &lt;/p&gt;

&lt;p&gt;That works for a short walk, but what if the road is 10,000 miles long and I ask you 1,000 different questions? You’d be exhausted! &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Prefix Sum is a preprocessing technique used to create a “running total” of an array. By doing a little bit of work upfront to sum up the elements as you go, you can answer any “range sum” query, asking for the total between any two points in constant time. It turns a repetitive addition task into a simple subtraction task.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The Mathematical Logic
&lt;/h2&gt;

&lt;p&gt;The math behind a Prefix Sum is beautifully simple. We create a new array, let’s call it newArray, where each element at index i stores the sum of all elements from the start of the original array prevArray up to that index. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Formula:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;newArray[i] = prevArray[0] + prevArray[1] + ... + prevArray[i]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Or, more efficiently:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;newArray[i] = newArray[i-1] + prevArray[i]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;A Simple Example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s say we have an array of numbers: A = [3, 1, 4, 1, 5]&lt;/p&gt;

&lt;p&gt;To build the Prefix Sum array (P), we add as we go:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Index 0&lt;/strong&gt;: 3&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Index 1&lt;/strong&gt;: 3 + 1 = 4&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Index 2&lt;/strong&gt;: 4 + 4 = 8&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Index 3&lt;/strong&gt;: 8 + 1 = 9&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Index 4&lt;/strong&gt;: 9 + 5 = 14&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Prefix Sum Array (P)&lt;/strong&gt;: [3, 4, 8, 9, 14]&lt;/p&gt;

&lt;p&gt;Now, if you want the sum of elements from &lt;strong&gt;index 2 to 4&lt;/strong&gt; (which are 4, 1, 5), instead of adding them, you just take the total at index 4 and subtract the total before &lt;strong&gt;index 2&lt;/strong&gt;:&lt;br&gt;
&lt;strong&gt;Result&lt;/strong&gt;: 14–4 = 10&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This works because:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;P[4] = A0 + A1 + A2 + A3 + A4&lt;br&gt;
P[2 — 1] = A0 + A1&lt;/p&gt;

&lt;p&gt;So,&lt;br&gt;
P[4] — P[2 — 1]= A2 + A3 + A4&lt;/p&gt;


&lt;h2&gt;
  
  
  Efficiency and Complexity
&lt;/h2&gt;

&lt;p&gt;Before we break down the performance of this algorithm, it’s important to understand how we measure “speed” and “memory” in the coding world. We use something called Big-O Notation. If you aren’t familiar with terms like O(n) or O(1), or if you just need a quick refresher so you don’t get lost in the numbers, check out my previous guide &lt;a href="https://dev.to/prasanth_sivakumar/how-algorithms-scale-with-input-size-breaking-down-big-o-3np2"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it solves Time Complexity&lt;/strong&gt; &lt;br&gt;
Without Prefix Sum, if you want to find the sum of a range in an array of size N, you have to loop through it, which takes O(N) time. If you have M queries, your total time is O(M x N). That’s slow! With Prefix Sum, we spend O(N) time once to build the sum array. After that, every single query is answered instantly in O(1) (constant time) because it’s just a simple subtraction. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it solves Space Complexity&lt;/strong&gt; &lt;br&gt;
The trade-off for all that speed is memory. We usually create a new array of the same size as the original to store our running totals. Therefore, Space Complexity: O(N) However, in some cases, if you don’t need to keep the original numbers, you can overwrite the original array to achieve O(1) extra space!&lt;/p&gt;


&lt;h2&gt;
  
  
  Where is it used? (Applications)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Financial &amp;amp; Sales Analytics&lt;/strong&gt;: Imagine a dashboard showing total revenue over any custom date range. The system can now calculate the total for a week, month, or quarter instantly, regardless of how many years of data you have.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Image Processing&lt;/strong&gt;: In computer vision (like the filters on your phone), a 2D version of Prefix Sum called a Summed-Area Table is used to quickly blur images or detect features. It allows the computer to calculate the average color of any rectangular group of pixels in constant time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Web Analytics&lt;/strong&gt;: Tracking cumulative website visitors or “active users” over time series data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database Query Optimization&lt;/strong&gt;: Databases use it to speed up “range scans” or “aggregate queries.” When you run a query asking for data between two timestamps, the database might use prefix-style pre-computations to give you the answer faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Game Development&lt;/strong&gt;: Calculating cumulative scores, resources gained over a level, or even managing lighting and shadows in 2D space.&lt;/p&gt;


&lt;h2&gt;
  
  
  Classic Interview Problems
&lt;/h2&gt;

&lt;p&gt;If you are heading into a coding interview, there are a few “Famous” problems that almost always use Prefix Sum. Recognizing these early will save you a ton of time and stress!&lt;/p&gt;

&lt;p&gt;You are given an array and asked to find the sum of elements between two indices multiple times. This is the “Hello World” of Prefix Sum.&lt;/p&gt;

&lt;p&gt;You need to find an index where the sum of numbers to the left equals the sum of numbers to the right.&lt;/p&gt;

&lt;p&gt;Subarray Sum Equals K: A classic “Level Up” problem. It combines Prefix Sum with a HashMap to find the number of subarrays that add up to a specific value K.&lt;/p&gt;

&lt;p&gt;A very beginner-friendly problem where you track net gain/loss at each step essentially building a Prefix Sum array as you “climb.”&lt;/p&gt;


&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;p&gt;Now, let’s see this pattern in action!&lt;/p&gt;

&lt;p&gt;For these demonstrations, I’ll be using C#. However, don’t let the language choice stop you if you usually code in Python, Java, JavaScript etc. The logic and the underlying pattern remain exactly the same across all languages, only the syntax changes. Feel free to follow along and implement the logic in your own preferred language.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using System;

public class PrefixSumExample
{
    public static void Main()
    {
        int[] nums = { 3, 1, 4, 1, 5 };

        // Preprocessing: Build the Prefix Sum Array
        int[] prefixSum = BuildPrefixSum(nums);

        // Querying: Get sum of range [index 1 to 3] (values: 1, 4, 1)
        // Expected: 6
        int result = GetRangeSum(prefixSum, 1, 3);

        Console.WriteLine("\nSum of range [1 to 3]: " + result);
    }

    public static int[] BuildPrefixSum(int[] A)
    {
        int n = A.Length;
        int[] P = new int[n];

        // The first element is always the same
        P[0] = A[0]; 

        for (int i = 1; i &amp;lt; n; i++)
        {
            // Current Total = Previous Total + Current Element
            P[i] = P[i - 1] + A[i];
        }

        return P;
    }

    public static int GetRangeSum(int[] P, int left, int right)
    {
        // Sum(left, right) = P[right] - P[left - 1]
        if (left == 0) return P[right];

        return P[right] - P[left - 1];
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Practice Roadmap
&lt;/h2&gt;

&lt;p&gt;Theory is great, but coding is a sport. You only get better by practicing! To help you master this pattern, I’ve curated a list of LeetCode problems. To get the most out of your study time, I recommend following the 3:6:1 ratio (or the 3:5:2 if you’re feeling brave!):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;30% &lt;strong&gt;Easy&lt;/strong&gt; to build your confidence and grasp the core logic.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://leetcode.com/problems/running-sum-of-1d-array/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/running-sum-of-1d-array/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://leetcode.com/problems/find-pivot-index/description/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/find-pivot-index/description/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://leetcode.com/problems/find-the-highest-altitude/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/find-the-highest-altitude/&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;50% &lt;strong&gt;Medium&lt;/strong&gt; to learn how to apply the pattern in tricky scenarios.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://leetcode.com/problems/subarray-sum-equals-k/description/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/subarray-sum-equals-k/description/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://leetcode.com/problems/product-of-array-except-self/description/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/product-of-array-except-self/description/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://leetcode.com/problems/range-sum-query-2d-immutable/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/range-sum-query-2d-immutable/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://leetcode.com/problems/minimum-size-subarray-sum/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/minimum-size-subarray-sum/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://leetcode.com/problems/contiguous-array/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/contiguous-array/&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;20% &lt;strong&gt;Hard&lt;/strong&gt; to challenge your limits and see the pattern at its peak.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://leetcode.com/problems/max-sum-of-rectangle-no-larger-than-k/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/max-sum-of-rectangle-no-larger-than-k/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://leetcode.com/problems/trapping-rain-water/description/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/trapping-rain-water/description/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Don’t get discouraged if you get stuck! The goal isn’t to solve it in five minutes; the goal is to recognise the pattern. Happy coding!&lt;/p&gt;




&lt;p&gt;Stay updated with the latest insights and tutorials by following me on &lt;a href="https://sivakumar-prasanth.medium.com/" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;, &lt;a href="https://dev.to/prasanth_sivakumar"&gt;dev.io&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/prasanthse1996" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. For any inquiries for games or questions, feel free to reach out to me via &lt;a href="mailto:prasanth15sp@gmail.com"&gt;email&lt;/a&gt;. I’m here to assist you with any queries you may have!&lt;/p&gt;

&lt;p&gt;Don’t miss out on future articles and development tips!&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>beginners</category>
      <category>computerscience</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How Algorithms Scale with Input Size: Breaking Down Big-O</title>
      <dc:creator>Sivakumar Prasanth</dc:creator>
      <pubDate>Mon, 23 Feb 2026 02:16:15 +0000</pubDate>
      <link>https://forem.com/prasanth_sivakumar/how-algorithms-scale-with-input-size-breaking-down-big-o-3np2</link>
      <guid>https://forem.com/prasanth_sivakumar/how-algorithms-scale-with-input-size-breaking-down-big-o-3np2</guid>
      <description>&lt;p&gt;When it comes to writing efficient code, understanding how your algorithms perform as the input size grows is crucial. This is where time complexity and Big-O notation come in. &lt;/p&gt;

&lt;p&gt;In this blog, we’ll break down the most common time complexities from constant time to factorial time and explain why they matter for every programmer aiming to write fast, efficient code.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is “O” in Big-O notation?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;The “O” stands for “Order of”, as in the order of growth of an algorithm. It’s part of Big-O notation, which is used to describe the upper bound (worst-case) growth rate of an algorithm’s time or space requirements as input size increases. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Computing the time complexity of code involves analyzing how the running time grows with the input size (typically denoted as n). &lt;/p&gt;

&lt;p&gt;Here’s a structured way to approach it:&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 01:
&lt;/h2&gt;

&lt;p&gt;Identify the input Figure out what constitutes the input and denote the size of the input with a variable, commonly n.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function sumArray(arr) {
    let sum = 0;
    for (let i = 0; i &amp;lt; arr.length; i++) {
        sum += arr[i];
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, n = arr.length&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 02:
&lt;/h2&gt;

&lt;p&gt;Count the operations inside loops Focus on the most repeated operations: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simple for loop:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (let i = 0; i &amp;lt; n; i++) { ... }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;→ O(n)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nested loops:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (let i = 0; i &amp;lt; n; i++) {
  for (let j = 0; j &amp;lt; n; j++) { ... }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;→ O(n²)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Loop with &lt;a href="https://nor-blog.pages.dev/posts/2021-11-07-binary-search/" rel="noopener noreferrer"&gt;input halving&lt;/a&gt;:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while (low &amp;lt;= high) {
    mid = (low + high) / 2;
    ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;→ O(log n)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recursive calls:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function factorial(n) {
  if (n === 0) return 1;
  return n * factorial(n - 1);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;→ O(n log n)&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 03: Ignore constants and lower-order terms
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If something is O(3n + 10) → it’s O(n) &lt;/li&gt;
&lt;li&gt;If it’s O(n² + n) → it’s O(n²)&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Here’s the Big-O time complexities ordered from fastest to slowest (i.e., least to most complex) as input size n increases:&lt;/p&gt;

&lt;p&gt;1️⃣ O(1) → Constant time Fastest and doesn’t depend on input size &lt;br&gt;
2️⃣ O(log n) → Logarithmic time Very efficient &lt;br&gt;
3️⃣ O(n) → Linear time Grows directly with input size &lt;br&gt;
4️⃣ O(n log n) → Linearithmic time Slightly slower than linear &lt;br&gt;
5️⃣ O(n²) → Quadratic time Slows down fast &lt;br&gt;
6️⃣ O(n³) → Cubic time Very slow &lt;br&gt;
7️⃣ O(2ⁿ) → Exponential time Grows extremely fast so not practical for large n &lt;br&gt;
8️⃣ O(n!) → Factorial time Worst and blows up even for small n 📌 &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Ordered List&lt;/strong&gt;: O(1) &amp;lt; O(log n) &amp;lt; O(n) &amp;lt; O(n log n) &amp;lt; O(n²) &amp;lt; O(n³) &amp;lt; O(2ⁿ) &amp;lt; O(n!)&lt;/p&gt;




&lt;p&gt;Understanding time complexity is essential for writing efficient and scalable code. By using Big-O notation, we can analyze how an algorithm’s performance changes with input size, allowing us to make informed decisions about which approach to use. &lt;/p&gt;

&lt;p&gt;As you continue to code, keep these time complexities in mind; they’re not just theoretical as well practical tools for better problem-solving.&lt;/p&gt;




&lt;p&gt;Stay updated with the latest insights and tutorials by following me on &lt;a href="https://sivakumar-prasanth.medium.com/" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;, &lt;a href="https://dev.to/prasanth_sivakumar"&gt;dev.io&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/prasanthse1996" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. For any inquiries for games or questions, feel free to reach out to me via &lt;a href="mailto:prasanth15sp@gmail.com"&gt;email&lt;/a&gt;. I’m here to assist you with any queries you may have!&lt;/p&gt;

&lt;p&gt;Don’t miss out on future articles and development tips!&lt;/p&gt;

</description>
      <category>bigonotation</category>
      <category>timecomplexity</category>
      <category>algorithms</category>
      <category>codingefficiency</category>
    </item>
    <item>
      <title>Beyond the Script: A Masterclass in Video Game Subtitling</title>
      <dc:creator>Sivakumar Prasanth</dc:creator>
      <pubDate>Sun, 22 Feb 2026 02:48:18 +0000</pubDate>
      <link>https://forem.com/prasanth_sivakumar/beyond-the-script-a-masterclass-in-video-game-subtitling-2114</link>
      <guid>https://forem.com/prasanth_sivakumar/beyond-the-script-a-masterclass-in-video-game-subtitling-2114</guid>
      <description>&lt;p&gt;Let’s be honest: we’ve all been there. You’re playing an epic RPG, a character is whispering a dark, ancient secret, and the subtitles are either microscopic, blending into the snow, or flying past at the speed of light.&lt;/p&gt;

&lt;p&gt;Subtitles aren’t just a “nice-to-have” anymore.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Roughly 60% of gamers use them,&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;whether they have hearing disabilities, noisy roommates, or just want to make sure they didn’t miss that one weird elven pun. Based on the legendary GDC talk by Ian Hamilton (and some 80.lv wisdom), here are the golden rules to making your subtitles actually… well, readable.&lt;/p&gt;




&lt;h2&gt;
  
  
  Size Matters (Don’t Deny It)
&lt;/h2&gt;

&lt;p&gt;Tiny text is the enemy of joy. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Golden Number&lt;/strong&gt;: Aim for at least 46px at 1080p.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Battle of Contrast
&lt;/h2&gt;

&lt;p&gt;If your text is white and your game is set in a blizzard, your players are going to have a bad time. &lt;/p&gt;

&lt;p&gt;Don’t just rely on shadows or outlines (those can be hard for players with dyslexia). Use a background box (letterboxing) behind the text. Bonus points if you let players adjust the opacity of that box!&lt;/p&gt;

&lt;p&gt;⚠️ The Contrast Cheat Sheet: &amp;gt; To keep things accessible, aim for a contrast ratio of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;4.5:1&lt;/strong&gt; for small text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3:1&lt;/strong&gt; for large text.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not sure if your colours work? Use these handy tools to check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://toolness.github.io/accessible-color-matrix/" rel="noopener noreferrer"&gt;Accessible Color Matrix&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webaim.org/resources/contrastchecker/" rel="noopener noreferrer"&gt;WebAIM Contrast Checker&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep it Simple, Keep it Clean
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Font Choice&lt;/strong&gt;: Use a clear Sans-Serif font. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Case Sensitive&lt;/strong&gt;: Avoid ALL CAPS. It feels like the game is screaming at the player.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Don’t Write a Novel
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The 2-Line Rule&lt;/strong&gt;: Stick to a maximum of 2 lines (3 in extreme emergencies). &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Character Count&lt;/strong&gt;: Keep it under 38 characters per line. If the text covers half the screen, you’re making a visual novel, not a subtitle.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who is Even Talking?
&lt;/h2&gt;

&lt;p&gt;If there are three NPCs on screen and a disembodied voice from a radio, the player needs to know who said what. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Label it&lt;/strong&gt;: Use speaker names (e.g., Geralt: “Hmm.”) or unique colours for different characters.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Location, Location, Location
&lt;/h2&gt;

&lt;p&gt;Keep your subtitles bottom — center. It’s where the human eye expects them to be. Putting them in random corners of the screen is a great way to give your players a neck ache.&lt;/p&gt;

&lt;h2&gt;
  
  
  Accuracy (No “Close Enough”)
&lt;/h2&gt;

&lt;p&gt;Voice actors love to ad-lib. That’s great for the performance, but terrible for subtitles. If the actor says “Yeah, let’s go,” but the text says “Yes, we shall depart,” it creates a weird cognitive itch for the player. Double-check your script against the final audio!&lt;/p&gt;

&lt;h2&gt;
  
  
  Subtitle Everything (The “Default” Rule)
&lt;/h2&gt;

&lt;p&gt;Don’t wait until the gameplay starts to offer subtitles. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Opening Cinematic&lt;/strong&gt;: Ensure they have text! &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Pro Move&lt;/strong&gt;: Have subtitles ON by default or ask the player their preference in the very first “Initial Setup” screen before the game even begins.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Captions vs. Subtitles
&lt;/h2&gt;

&lt;p&gt;Subtitles are for speech. Captions are for sounds. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If a creeper is hissing behind the player, or a door is creaking to the left, add a caption: [Eerie creaking from the left]. This is a literal game-changer for accessibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Give Them Time to Breathe
&lt;/h2&gt;

&lt;p&gt;Don’t flash text on the screen for half a second. Use timings that allow for a natural reading pace. If the character talks like a machine gun, you might need to edit the text slightly for brevity , but try to keep the soul of the dialogue intact.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Magic Numbers&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Minimum Stay&lt;/strong&gt;: No subtitle should be on screen for less than 1.5 to 2 seconds, even if the character just says “Hi.” Anything shorter is just a blink. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Reading Speed&lt;/strong&gt;: Aim for a pace of about 15 to 20 characters per second. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The “Linger” Factor&lt;/strong&gt;: Leave the subtitle on screen for about 0.3 to 0.5 seconds after the audio ends. This gives the brain a tiny moment to finish processing the sentence before it disappears. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Gap&lt;/strong&gt;: Leave at least 2 frames (about 0.1 seconds) of “blank space” between two different subtitles. If one replaces the other instantly, the eye might not even realise the text changed!&lt;/li&gt;
&lt;/ul&gt;




&lt;blockquote&gt;
&lt;p&gt;The Ultimate Secret: Options! &lt;br&gt;
If there is one takeaway, it’s this: Customization is King. The more toggles you give the player; size, background, speaker names, colors, the more “awards” your game wins in the hearts of players.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Stay updated with the latest insights and tutorials by following me on &lt;a href="https://sivakumar-prasanth.medium.com/" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;, &lt;a href="https://dev.to/prasanth_sivakumar"&gt;dev.io&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/prasanthse1996" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. For any inquiries for games or questions, feel free to reach out to me via &lt;a href="mailto:prasanth15sp@gmail.com"&gt;email&lt;/a&gt;. I’m here to assist you with any queries you may have!&lt;/p&gt;

&lt;p&gt;Don’t miss out on future articles and development tips!&lt;/p&gt;

</description>
      <category>subtitles</category>
      <category>captions</category>
      <category>gamedesign</category>
      <category>uiuxcasestudy</category>
    </item>
    <item>
      <title>From Brainstorm to Build: Why Every Indie Game Needs a Game Design Document (GDD)</title>
      <dc:creator>Sivakumar Prasanth</dc:creator>
      <pubDate>Sat, 21 Feb 2026 08:41:19 +0000</pubDate>
      <link>https://forem.com/prasanth_sivakumar/from-brainstorm-to-build-why-every-indie-game-needs-a-game-design-document-gdd-5an3</link>
      <guid>https://forem.com/prasanth_sivakumar/from-brainstorm-to-build-why-every-indie-game-needs-a-game-design-document-gdd-5an3</guid>
      <description>&lt;p&gt;We’ve all been there. It’s 2 AM, you’re staring at the ceiling, and suddenly BAMMM…. The greatest game idea in history hits you. You’re going to make a game. It’s going to be glorious. &lt;/p&gt;

&lt;p&gt;But then you wake up the next morning, open your game engine, and… uh… what now? &lt;/p&gt;

&lt;p&gt;This is where the Game Design Document (GDD) saves your life.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2vcjdz0hv0ak23dxh16.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2vcjdz0hv0ak23dxh16.webp" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What is a GDD?
&lt;/h2&gt;

&lt;p&gt;Think of a GDD as the “North Star” for your project. It’s a living document that outlines everything your game is, what it does, and how it’s supposed to feel. &lt;/p&gt;

&lt;p&gt;It’s not meant to be a 500-page boring manual (unless you’re making the next GTA game). For us mere mortals, it’s a simple roadmap that keeps us from getting lost in “feature creep” hell.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why GDD?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Brain Dump&lt;/strong&gt;: It gets the ideas out of your head and onto paper so you don’t forget that “extra spicy” mechanic you thought of. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Focus&lt;/strong&gt;: It defines your “Minimum Viable Product” (MVP). It helps you decide what is actually necessary for the game to be fun.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Organization&lt;/strong&gt;: It helps you set milestones. Instead of “making a game,” you’re just “finishing Milestone #1”.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to Create One (Using My “Cow Abduction” Game as an Example)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;In this game, you take control of a UFO using a top-down perspective. The primary goal of the game is to fly through the area and pick up as many cows as possible to increase your score. However, the mission isn’t just a simple stroll through the pasture; you must skill-fully navigate the screen to avoid projectiles fired by helicopters. As the game progresses, the gameplay mechanics will become more challenging, making the survival of your alien pilot much more difficult.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let’s break down how to actually fill one out using a simple template.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fndofpxvtilq1lcns0zba.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fndofpxvtilq1lcns0zba.webp" alt=" " width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvmtwbps9fp0z239tk7wk.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvmtwbps9fp0z239tk7wk.webp" alt=" " width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fahuypvn46v1fi48aneuz.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fahuypvn46v1fi48aneuz.webp" alt=" " width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Timeline (Don’t skip this!)
&lt;/h2&gt;

&lt;p&gt;Don’t just code aimlessly. Set milestones:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl3txwop5dcpe2gc2e6tw.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl3txwop5dcpe2gc2e6tw.webp" alt=" " width="800" height="620"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Don’t Let it Sit in Your Brain!
&lt;/h2&gt;

&lt;p&gt;The biggest mistake is thinking you’ll “just remember it.” Write it down. Sketch it out. Even if it’s just a backlog of features you want to add later (like laser-eyes for the cows), put them in the backlog section so they don’t distract you now.&lt;/p&gt;




&lt;h2&gt;
  
  
  Grab My Template!
&lt;/h2&gt;

&lt;p&gt;To help you get started, I’ve put together a &lt;a href="https://docs.google.com/document/d/1zVdKBcVDOu3WpYvN0EnL1Ss4B0qHiMOiCU0CPR1o8Xo/edit?tab=t.0" rel="noopener noreferrer"&gt;GDD Template&lt;/a&gt; based on the one I used for my UFO game. It’s simple, clean, and won’t give you a headache.&lt;/p&gt;

&lt;p&gt;Happy developing! Now go and kidnap some cows!&lt;/p&gt;




&lt;p&gt;Stay updated with the latest insights and tutorials by following me on &lt;a href="https://sivakumar-prasanth.medium.com/" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;, &lt;a href="https://dev.to/prasanth_sivakumar"&gt;dev.io&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/prasanthse1996" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. For any inquiries for games or questions, feel free to reach out to me via &lt;a href="mailto:prasanth15sp@gmail.com"&gt;email&lt;/a&gt;. I’m here to assist you with any queries you may have!&lt;/p&gt;

&lt;p&gt;Don’t miss out on future articles and development tips!&lt;/p&gt;

</description>
      <category>gamedesigndocument</category>
      <category>gdd</category>
      <category>gamedev</category>
      <category>gamedocumentation</category>
    </item>
    <item>
      <title>Mastering State Machines in Unity: A Comprehensive Guide</title>
      <dc:creator>Sivakumar Prasanth</dc:creator>
      <pubDate>Tue, 17 Feb 2026 04:26:36 +0000</pubDate>
      <link>https://forem.com/prasanth_sivakumar/mastering-state-machines-in-unity-a-comprehensive-guide-1d05</link>
      <guid>https://forem.com/prasanth_sivakumar/mastering-state-machines-in-unity-a-comprehensive-guide-1d05</guid>
      <description>&lt;p&gt;Welcome to the world of Unity game development! In this article, we’ll delve deep into the concept of state machines and how they can revolutionise the way you manage game logic in your Unity projects. If you’re new to state machines or seeking to enhance your understanding, you’re in the right place. By the end of this read, you’ll have a solid grasp of state machines and how to implement them effectively in your game development endeavours. &lt;/p&gt;

&lt;p&gt;You can find my Github repository &lt;a href="https://github.com/prasanthse/unity-state-machine" rel="noopener noreferrer"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Let’s dive in!&lt;/p&gt;




&lt;h2&gt;
  
  
  What is a State Machine?
&lt;/h2&gt;

&lt;p&gt;A state machine is a fundamental concept in computer science and game development that models the behaviour of an entity by defining a finite set of states and transitions between them. Each state represents a specific behaviour or set of actions, and transitions dictate how and when the entity transitions between these states based on certain conditions or events.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flu24sguk5hdovhmykz0r.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flu24sguk5hdovhmykz0r.webp" alt=" " width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Do We Need State Machines in Game Development?
&lt;/h2&gt;

&lt;p&gt;State machines offer a structured and modular approach to managing complex behaviours in games. By organising code into discrete states, developers can improve readability, maintainability, and scalability. Additionally, state machines facilitate the implementation of sophisticated AI, player controls, animation systems, and more, leading to more robust and flexible game architectures.&lt;/p&gt;




&lt;h2&gt;
  
  
  Demo of My State Machine to Control Player States
&lt;/h2&gt;

&lt;p&gt;In this section, we’ll walk through a practical example of implementing a state machine to control player states in Unity. We’ll cover concepts such as player idle, walking, running, attacking and death, demonstrating how to structure the code using state-based logic. By the end, you’ll have a fully functional player controller powered by a state machine, ready to integrate into your own projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 01&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6f2alzbsjuy9p98h79y9.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6f2alzbsjuy9p98h79y9.webp" alt=" " width="800" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a BaseState abstract class. You can define common state behaviours, such as Enter, Update, and Exit methods, ensuring consistency and coherence across your state machine architecture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 02&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fket1jm6ckugyeegn7owa.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fket1jm6ckugyeegn7owa.webp" alt=" " width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now I created an ITriggerState interface to manage triggers within our state machine architecture. &lt;/p&gt;

&lt;p&gt;Feel free to divide the interfaces according to your needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 03&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkg3c24wxmral7p6nwgf3.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkg3c24wxmral7p6nwgf3.webp" alt=" " width="800" height="613"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This script is significant. The StateMachine class manages the entering, updating, and switching of states among objects. Since this class is generic, we can now utilise it for various objects such as players, enemies, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 04&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3mx3fuobh5mjpn41ja4j.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3mx3fuobh5mjpn41ja4j.webp" alt=" " width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, I’ve created a class called PlayerIdleState to manage the player’s idle state. This class encompasses all the necessary logic for the player while in the idle state. Similarly, you can create separate classes like this. For the demonstration purposes, I’ve created PlayerWalkState, PlayerRunState, PlayerAttackState, and PlayerDeathState.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4ht9grtc9tq1kqb595xp.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4ht9grtc9tq1kqb595xp.webp" alt=" " width="294" height="238"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since the aforementioned state classes extend the BaseState class, we can create separate classes for different objects with different states.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 05&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foq5xj10gnlhxv0dimfxq.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foq5xj10gnlhxv0dimfxq.webp" alt=" " width="800" height="850"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, I implemented the PlayerStateMachine class to utilize the StateMachine abstract class. This PlayerStateMachine will incorporate all the states of my player and facilitate the switching of our player’s states.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 06&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjl6e8pku4wv421s8txsc.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjl6e8pku4wv421s8txsc.webp" alt=" " width="800" height="944"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally I have my PlayerManager script :)&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;State machines are a powerful tool in the Unity developer’s arsenal, offering a structured approach to managing complex behaviours and interactions. By understanding the principles behind state machines and practicing their implementation, you’ll be equipped to tackle a wide range of game development challenges with confidence and efficiency. Remember to explore the accompanying sample code on GitHub to reinforce your learning and unleash your creativity in your Unity projects.&lt;/p&gt;




&lt;p&gt;Stay updated with the latest insights and tutorials by following me on &lt;a href="https://sivakumar-prasanth.medium.com/" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;, &lt;a href="https://dev.to/prasanth_sivakumar"&gt;dev.io&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/prasanthse1996" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. For any inquiries for games or questions, feel free to reach out to me via email. I’m here to assist you with any queries you may have!&lt;/p&gt;

&lt;p&gt;Don’t miss out on future articles and development tips!&lt;/p&gt;

</description>
      <category>statemachine</category>
      <category>finitestatemachine</category>
      <category>unity3d</category>
      <category>game</category>
    </item>
    <item>
      <title>Cinemachine in Unity: Elevate Your Game’s Camera System Like a Pro</title>
      <dc:creator>Sivakumar Prasanth</dc:creator>
      <pubDate>Mon, 16 Feb 2026 07:43:04 +0000</pubDate>
      <link>https://forem.com/prasanth_sivakumar/cinemachine-in-unity-elevate-your-games-camera-system-like-a-pro-18f6</link>
      <guid>https://forem.com/prasanth_sivakumar/cinemachine-in-unity-elevate-your-games-camera-system-like-a-pro-18f6</guid>
      <description>&lt;p&gt;Cinemachine is a &lt;strong&gt;powerful camera system&lt;/strong&gt; in Unity that automates and enhances camera control, making it easier to create dynamic and professional-quality camera movements without writing complex scripts.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why We Need Cinemachine?
&lt;/h2&gt;

&lt;p&gt;🔹 Eliminates Manual Camera Scripting — No need to write custom code for tracking, transitions, or shakes. &lt;br&gt;
🔹 Smart Camera Behaviour — Auto-adjusts based on object movement, avoiding obstacles and maintaining smooth shots. &lt;br&gt;
🔹 Blending &amp;amp; Transitions — Seamlessly switch between different cameras with cinematic effects. &lt;br&gt;
🔹 Advanced Tracking — Lock onto targets, follow players smoothly, and dynamically frame shots. &lt;br&gt;
🔹 Supports Different Genres — Works for FPS, third-person, top-down, racing, platformers, and cutscenes.&lt;/p&gt;


&lt;h2&gt;
  
  
  Cinemachine Camera Types in Unity
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Cinemachine Virtual Camera&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Most commonly used camera that allows following and looking at a target. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Features&lt;/strong&gt;: Follows a target, allows for damping and noise adjustments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Cinemachine FreeLook Camera&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allows free rotation around a target, great for third-person games. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Features&lt;/strong&gt;: Smooth transition between top, middle, and bottom rigs for varying zoom.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/X33t13gOBFw"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Cinemachine 2D Camera&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Specifically designed for 2D games. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Features&lt;/strong&gt;: Works with orthographic projection, follows targets smoothly, and is designed to handle 2D-style cameras.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/mWqX8GxeCBk"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Cinemachine Mixing Camera&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blends multiple cameras simultaneously. Instead of a predefined sequence, you can dynamically mix between multiple Cameras. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Features&lt;/strong&gt;: Instead of switching between cameras, the Mixing Camera blends them together based on weights (0 to 1). Allows seamless interpolation between different views.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Cinemachine Dolly Camera (With Track)&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Moves along a dolly track, creating on-rails movements. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Features&lt;/strong&gt;: Follows a path defined by a Spline or track, useful for cutscenes or guided movement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/q1fkx94vHtg"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Cinemachine Dolly Track with Cart&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A track-based camera system that uses a cart to follow the track. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Features&lt;/strong&gt;: The cart moves along the dolly track, typically used for cinematic sequences or scripted events.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7. Cinemachine State-Driven Camera&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatically switches between cameras based on animation states or game conditions. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Features&lt;/strong&gt;: Linked to the Animator to control camera switching.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/2X00qXErxIM"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Cinemachine ClearShot Camera&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chooses the best camera angle automatically from a set of cameras, great for dynamic cutscenes. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Features&lt;/strong&gt;: Automatically selects the best camera from a list of candidate cameras based on visibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/I9w-agFYZ3I"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Cinemachine Blend List Camera&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blends between multiple virtual cameras based on a list, one after another in a predefined sequence order. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Features&lt;/strong&gt;: Allows smooth transitions between cameras in a sequence, ideal for cutscenes or complex transitions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;10. Cinemachine Target Group Camera&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Focuses on a group of targets (like multiple players). &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Features&lt;/strong&gt;: Allows dynamic camera movement for multiple targets with adjustable priorities.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Where is Cinemachine Used?
&lt;/h2&gt;

&lt;p&gt;✅ FPS Games — Smooth aim, recoil, and camera shake effects. &lt;br&gt;
✅ Racing Games — Dynamic chase cameras, cockpit views. &lt;br&gt;
✅ Cutscenes &amp;amp; Storytelling — Cinematic transitions, zooms, and pans. &lt;br&gt;
✅ Open-World Games — Automatic tracking of players across large maps. &lt;br&gt;
✅ 2D Platformers — Side-scrolling cameras with precise following.&lt;/p&gt;




&lt;h2&gt;
  
  
  Is Cinemachine Good For Mobile Games?
&lt;/h2&gt;

&lt;p&gt;Cinemachine can be an excellent choice for mobile games, but like with any tool, it comes with both advantages and considerations. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages of Using Cinemachine in Mobile Games&lt;/strong&gt; &lt;br&gt;
🔹 Ease of use &lt;br&gt;
🔹 Smooth Camera Movements &lt;br&gt;
🔹 Camera Types and Versatility &lt;br&gt;
🔹 Mobile-Friendly &lt;br&gt;
🔹 Camera Blending and Switching &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Considerations When Using Cinemachine in Mobile Games&lt;/strong&gt; &lt;br&gt;
🔹 While Cinemachine is optimised for performance, it’s still important to monitor and optimise performance, especially on lower-end mobile devices &lt;br&gt;
🔹 Cinemachine cameras can consume more power than simpler, static cameras due to constant updates, camera movement, and smooth transitions &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Practices for Using Cinemachine in Mobile Games&lt;/strong&gt; &lt;br&gt;
🔹 Limit Complex Camera Transitions &lt;br&gt;
🔹 Opt for basic smoothing (position and rotation damping) over heavy noise or distortion effects &lt;br&gt;
🔹 Monitor Performance &lt;br&gt;
🔹 Test on Real Devices&lt;/p&gt;




&lt;p&gt;Cinemachine simplifies complex camera movements, making your game feel more polished and immersive without heavy coding. &lt;/p&gt;

&lt;p&gt;This is a great tool for mobile game development. However, for optimal performance, it’s important to balance the complexity of your camera systems, by following best practices can be effectively used to create high-quality, dynamic camera systems for mobile games. &lt;/p&gt;

&lt;p&gt;Whether you’re working on an FPS, RPG, racing, or cinematic cutscenes, Cinemachine helps you achieve professional-quality visuals effortlessly.&lt;/p&gt;




&lt;p&gt;Stay updated with the latest insights and tutorials by following me on &lt;a href="https://sivakumar-prasanth.medium.com/" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;, &lt;a href="https://dev.to/prasanth_sivakumar"&gt;dev.io&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/prasanthse1996" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. For any inquiries for games or questions, feel free to reach out to me via &lt;a href="mailto:prasanth15sp@gmail.com"&gt;email&lt;/a&gt;. I’m here to assist you with any queries you may have!&lt;/p&gt;

&lt;p&gt;Don’t miss out on future articles and development tips!&lt;/p&gt;

</description>
      <category>cinemachine</category>
      <category>unitycinemachine</category>
      <category>unity3d</category>
      <category>camera</category>
    </item>
    <item>
      <title>A* Algorithm vs Unity NavMesh: Choosing the Right Pathfinding for Your Game</title>
      <dc:creator>Sivakumar Prasanth</dc:creator>
      <pubDate>Sun, 15 Feb 2026 02:27:14 +0000</pubDate>
      <link>https://forem.com/prasanth_sivakumar/a-algorithm-vs-unity-navmesh-choosing-the-right-pathfinding-for-your-game-3l5l</link>
      <guid>https://forem.com/prasanth_sivakumar/a-algorithm-vs-unity-navmesh-choosing-the-right-pathfinding-for-your-game-3l5l</guid>
      <description>&lt;h2&gt;
  
  
  What’s A*?
&lt;/h2&gt;

&lt;p&gt;A* (A-star) is a search algorithm used to find the shortest path between two points on a grid or graph.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fik7nwsgw4da0bx5rzz2f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fik7nwsgw4da0bx5rzz2f.png" alt=" " width="682" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s Unity NavMesh?
&lt;/h2&gt;

&lt;p&gt;NavMesh is Unity’s built-in navigation system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qbrs9c3vl1jnw8t4yz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qbrs9c3vl1jnw8t4yz0.png" alt=" " width="800" height="684"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  When to Use A* Algorithm
&lt;/h2&gt;

&lt;p&gt;✅ &lt;strong&gt;2D Grid-Based Games&lt;/strong&gt;: Great for top-down, tile-map games like Pokémon, Fire Emblem &lt;br&gt;
✅ &lt;strong&gt;Custom Pathfinding&lt;/strong&gt;: You need full control over the algorithm or grid &lt;br&gt;
✅ &lt;strong&gt;No Unity Engine (Custom Engine)&lt;/strong&gt;: You’re building from scratch &lt;br&gt;
✅ &lt;strong&gt;Dynamic or Procedural Worlds&lt;/strong&gt;: You generate maps at runtime and need custom solutions &lt;br&gt;
✅ &lt;strong&gt;Low-poly / Small Worlds&lt;/strong&gt;: Simple grid = fast A* computation&lt;/p&gt;

&lt;h2&gt;
  
  
  When NOT to Use A* (Use NavMesh Instead)
&lt;/h2&gt;

&lt;p&gt;🚫 &lt;strong&gt;3D Terrain or Complex Geometry&lt;/strong&gt;: A* doesn’t understand 3D mesh surfaces &lt;br&gt;
🚫 &lt;strong&gt;Need Agent Features&lt;/strong&gt;: No built-in agent radius/height, obstacle avoidance &lt;br&gt;
🚫 &lt;strong&gt;Performance Bottlenecks in Large Maps&lt;/strong&gt;: Grid-based A* gets slow as grid size increases &lt;br&gt;
🚫 &lt;strong&gt;Want Auto Pathfinding in Unity&lt;/strong&gt;: Unity NavMesh does the heavy lifting automatically&lt;/p&gt;




&lt;h2&gt;
  
  
  When to Use Unity NavMesh
&lt;/h2&gt;

&lt;p&gt;✅ &lt;strong&gt;3D Games (FPS, Adventure)&lt;/strong&gt;: Works out of the box with terrain, stairs, ramps &lt;br&gt;
✅ &lt;strong&gt;You’re Using Unity&lt;/strong&gt;: Built-in, highly optimized, works with Agents and Obstacles &lt;br&gt;
✅ &lt;strong&gt;Want Dynamic Pathfinding&lt;/strong&gt;: NavMesh can update with NavMesh Surface or Carving &lt;br&gt;
✅ &lt;strong&gt;Need Agent-Based AI&lt;/strong&gt;: Handles multiple AI units with different sizes/behavior&lt;/p&gt;

&lt;h2&gt;
  
  
  When NOT to Use NavMesh (Use A* Instead)
&lt;/h2&gt;

&lt;p&gt;🚫 &lt;strong&gt;2D Games&lt;/strong&gt;: NavMesh is mainly for 3D navigation (2D support is hacky) &lt;br&gt;
🚫 &lt;strong&gt;Fully Dynamic Worlds&lt;/strong&gt;: You can’t rebake NavMesh instantly at runtime &lt;br&gt;
🚫 &lt;strong&gt;Custom Game Engines&lt;/strong&gt;: NavMesh is Unity-specific &lt;br&gt;
🚫 &lt;strong&gt;Hex or Irregular Grids&lt;/strong&gt;: NavMesh doesn’t support custom-shaped tile systems natively&lt;/p&gt;

&lt;p&gt;Find my NavMesh Demo Project &lt;a href="https://github.com/prasanthse/Unity-NavMesh-Ai-Path-Finding" rel="noopener noreferrer"&gt;Here&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  TL;DR Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Top-down 2D tile game: A*&lt;/li&gt;
&lt;li&gt;3D Adventure/FPS: NavMesh&lt;/li&gt;
&lt;li&gt;Procedural dungeons: A*&lt;/li&gt;
&lt;li&gt;RTS / MOBA (3D with units): NavMesh&lt;/li&gt;
&lt;li&gt;Custom logic / AI testing: A*&lt;/li&gt;
&lt;li&gt;Unity 3D project with terrain: NavMesh&lt;/li&gt;
&lt;/ul&gt;




&lt;blockquote&gt;
&lt;p&gt;How do I handle dynamic environments in a 3D game where the NavMesh must update instantly at runtime?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Unity’s built-in NavMesh system is not ideal for highly dynamic environments. But there are workarounds &amp;amp; better solutions depending on your game’s needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why NavMesh is Limited in Dynamic Worlds&lt;/strong&gt; &lt;br&gt;
Unity’s NavMesh baking is not real-time. It takes time and can’t rebake every frame. Even NavMeshObstacle with carving only supports: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple object avoidance &lt;/li&gt;
&lt;li&gt;No large-scale changes (like terrain deformation or new platforms appearing) &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So if your game has: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Platforms moving &lt;/li&gt;
&lt;li&gt;Terrain changing &lt;/li&gt;
&lt;li&gt;Buildings spawning/despawning &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You need more flexible solutions….&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Solutions for Real-Time Navigation in Dynamic 3D Worlds
&lt;/h2&gt;

&lt;p&gt;✅ Use NavMesh with Carving enabled for minor changes like doors, crates, small obstacles &lt;/p&gt;

&lt;p&gt;✅ Use &lt;a href="https://github.com/Unity-Technologies/NavMeshComponents" rel="noopener noreferrer"&gt;NavMeshComponents package&lt;/a&gt;, when only parts of the environment change &lt;/p&gt;

&lt;p&gt;✅ A Pathfinding Project (by Aron Granberg)* &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Best for fully dynamic 3D worlds &lt;/li&gt;
&lt;li&gt;Supports grid, navmesh, and point graph types &lt;/li&gt;
&lt;li&gt;Real-time updates &amp;amp; graph recalculations &lt;/li&gt;
&lt;li&gt;Unity compatible and production-ready&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why it rocks: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real-time updates &lt;/li&gt;
&lt;li&gt;Supports layered worlds, moving platforms &lt;/li&gt;
&lt;li&gt;Optimised &amp;amp; widely used in indie and AAA&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Find Aron Granberg’s path finding projects:&lt;br&gt;
&lt;a href="https://arongranberg.com/astar/features" rel="noopener noreferrer"&gt;Free&lt;/a&gt;&lt;br&gt;
&lt;a href="https://assetstore.unity.com/packages/tools/behavior-ai/a-pathfinding-project-pro-87744?srsltid=AfmBOooIJUUE6XRbsepOl6TWnnoDc4G4bk2PT8FPLMLianCWeDJGBBYZ#reviews" rel="noopener noreferrer"&gt;Paid&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Many devs switch to this when Unity’s NavMesh isn’t enough.&lt;/p&gt;




&lt;p&gt;Stay updated with the latest insights and tutorials by following me on &lt;a href="https://medium.com/@sivakumar-prasanth" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;, &lt;a href="https://dev.to/prasanth_sivakumar"&gt;dev.io&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/prasanthse1996" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. For any inquiries for games or questions, feel free to reach out to me via email. I’m here to assist you with any queries you may have! &lt;/p&gt;

&lt;p&gt;Don’t miss out on future articles and development tips!&lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>astaralgorithm</category>
      <category>pathfinding</category>
      <category>unitynavmesh</category>
    </item>
    <item>
      <title>From Code to Shape: A Beginner’s Guide to Unity Mesh Generation</title>
      <dc:creator>Sivakumar Prasanth</dc:creator>
      <pubDate>Sat, 14 Feb 2026 11:16:39 +0000</pubDate>
      <link>https://forem.com/prasanth_sivakumar/from-code-to-shape-a-beginners-guide-to-unity-mesh-generation-gff</link>
      <guid>https://forem.com/prasanth_sivakumar/from-code-to-shape-a-beginners-guide-to-unity-mesh-generation-gff</guid>
      <description>&lt;p&gt;If you’ve ever wondered how 3D models are built behind the scenes in Unity. While most developers use imported 3D models, Unity also gives you full control to create meshes directly through code. In this blog, we’ll break down the core components of a mesh and walk through how to create a custom mesh using C#. &lt;/p&gt;

&lt;p&gt;Whether you’re aiming to generate procedural terrain, dynamic characters, or just want to better understand Unity’s rendering pipeline, this guide will give you the foundation to start crafting geometry with code.&lt;/p&gt;




&lt;p&gt;Before we start writing code to generate a mesh, it’s important to understand the key components involved in rendering geometry in Unity. &lt;/p&gt;

&lt;h2&gt;
  
  
  Mesh
&lt;/h2&gt;

&lt;p&gt;A Mesh is the fundamental building block for rendering 3D models. It is a collection of vertices, triangles, and UVs that together define the shape and surface appearance of a 3D object. Think of it as the skeleton of a model.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqbm5tdflx7zyjwn790o.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqbm5tdflx7zyjwn790o.webp" alt=" " width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Mesh Filter
&lt;/h2&gt;

&lt;p&gt;The Mesh Filter is a component that holds a reference to a mesh. It doesn’t render the mesh or affect how it looks. It simply passes the mesh data to the rendering system. If the mesh is the blueprint, the Mesh Filter is the middleman that hands it to Unity’s renderer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqat32xufyogby0doab4h.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqat32xufyogby0doab4h.webp" alt=" " width="800" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Mesh Renderer
&lt;/h2&gt;

&lt;p&gt;The Mesh Renderer is responsible for taking the mesh from the Mesh Filter and drawing it on the screen. It handles materials, shaders, and lighting, determining how the mesh will look in the scene. You can think of it as the artist who paints the mesh and makes it visible to the camera.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd201oddto3c64sd7aojh.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd201oddto3c64sd7aojh.webp" alt=" " width="477" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  In Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mesh&lt;/strong&gt; = The raw data (vertices, triangles, UVs). &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mesh Filter&lt;/strong&gt; = Holds and passes the mesh to be rendered. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mesh Renderer&lt;/strong&gt; = Renders the mesh with materials and lighting.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Now that we understand what a Mesh, Mesh Filter, and Mesh Renderer are, let’s see them in action. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 01&lt;/strong&gt;: Create an Empty GameObject &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 02&lt;/strong&gt;: Add Mesh Filter and Mesh Renderer Components&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiy6ml8ik2cpwtq1qbs65.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiy6ml8ik2cpwtq1qbs65.webp" alt=" " width="800" height="754"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 03&lt;/strong&gt;: Create a New Material&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 04&lt;/strong&gt;: Assign a Texture (Optional for Demo)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fncgkyax5t7halt86l3rp.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fncgkyax5t7halt86l3rp.webp" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 05&lt;/strong&gt;: Assign the Material to the Mesh Renderer&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxh2vmweiiosfrmwp4jw4.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxh2vmweiiosfrmwp4jw4.webp" alt=" " width="800" height="636"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding Vertices, UVs, and Triangles
&lt;/h2&gt;

&lt;p&gt;Before we start coding, it’s crucial to understand the three fundamental building blocks of any mesh: &lt;strong&gt;vertices, UVs, and triangles&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vertices
&lt;/h2&gt;

&lt;p&gt;A vertex is a point in 3D space, defined by a coordinate (x, y, z). When you create a mesh, you define its shape by specifying a set of these points. For example, to make a simple triangle, you need three vertices. To create a square (quad), you need four. Think of vertices as the corners or dots that outline your object’s shape.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1sjf56muou0y5zwp6ba.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1sjf56muou0y5zwp6ba.webp" alt=" " width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  UVs
&lt;/h2&gt;

&lt;p&gt;UVs are coordinates that map a texture onto your mesh. While vertices define the shape, UVs tell Unity how to paint it. UV coordinates range from (0, 0) to (1, 1), where (0, 0) is the bottom-left of the texture and (1, 1) is the top-right. Each vertex must have a corresponding UV coordinate to ensure the texture is correctly applied.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7adk3plj7m3yb0ho0493.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7adk3plj7m3yb0ho0493.webp" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Triangles
&lt;/h2&gt;

&lt;p&gt;Triangles define how vertices are connected to form surfaces. Every 3D shape in Unity is made up of triangles. Even quads are just two triangles joined together. A triangle is defined by three indices.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe2ssk7cns0ncgqwhbqya.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe2ssk7cns0ncgqwhbqya.webp" alt=" " width="629" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The order of these indices matters. It determines which direction the triangle faces (called the winding order). Unity uses a clockwise order to decide the front face of the triangle. Similarly, If needs to show back face, uses counter clock wise.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foe4of8q1f4gkp1xz0ce2.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foe4of8q1f4gkp1xz0ce2.webp" alt=" " width="584" height="375"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Time to Code: Creating a Triangle from Scratch
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 01: Create a new mesh instance&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mesh mesh = new Mesh();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This initializes a new instance of the Mesh class. This will store all the geometry data (vertices, UVs, and triangles) for your custom shape.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 02: Assign the mesh to the MeshFilter component on the current GameObject&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GetComponent&amp;lt;MeshFilter&amp;gt;().mesh = mesh;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We get the MeshFilter component attached to this GameObject and assign our newly created mesh to it. This tells Unity to use our custom mesh when rendering.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 03: Define arrays for vertices, UVs, and triangles with 3 elements (we’re making a single triangle)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Vector3[] vertices = new Vector3[3];
Vector2[] uv = new Vector2[3];
int[] triangles = new int[3];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We declare three arrays to hold the data needed for the mesh &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vertices&lt;/strong&gt;: the 3D coordinates of each point. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;uv&lt;/strong&gt;: the texture coordinates for each vertex. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;triangles&lt;/strong&gt;: the order in which the vertices are connected to form a triangle.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 04: Set the vertex positions (in local space)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vertices[0] = new Vector3(0, 0, 0);     // Bottom-left
vertices[1] = new Vector3(0, 20, 0);    // Top-left
vertices[2] = new Vector3(20, 20, 0);   // Top-right
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are the positions of the three corners of the triangle in 3D space. They define the shape and size of the mesh. This triangle will appear upright and flat on the XY plane.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 05: Set UV coordinates corresponding to each vertex&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv[0] = new Vector2(0, 0);  // Bottom-left of the texture
uv[1] = new Vector2(0, 1);  // Top-left of the texture
uv[2] = new Vector2(1, 1);  // Top-right of the texture
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These coordinates determine how the texture is mapped onto the triangle. UVs are in 2D (X and Y), ranging from 0 to 1, and are aligned with the texture’s corners.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 06: Define the order of vertices to form the triangle&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;triangles[0] = 0;
triangles[1] = 1;
triangles[2] = 2;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells Unity how to connect the vertices to make a triangle. It connects vertex 0 → 1 → 2 in a clockwise order, which defines the front-facing side.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 07: Assign the arrays to the mesh&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mesh.vertices = vertices;
mesh.uv = uv;
mesh.triangles = triangles;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we assign our data to the mesh object. Unity now knows what shape to draw (vertices + triangles) and how to map the texture (UVs).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Script: Generating a Simple Mesh in Unity via Code&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using UnityEngine;

public class MeshGenerator : MonoBehaviour
{
    private Mesh mesh;

    private void Start()
    {
        // Create a new mesh instance
        mesh = new Mesh();

        // Assign the mesh to the Meshfilter
        GetComponent&amp;lt;MeshFilter&amp;gt;().mesh = mesh;

        CreateTriangle();
    }

    private void CreateTriangle()
    {
        // Define arrays for vertices, UVs, and triangles
        Vector3[] vertices = new Vector3[3]; // A triangle has 3 vertex
        Vector2[] uv = new Vector2[3]; // Each vertex should have a currosponding UV coordinate 
        int[] triangles = new int[3]; // A triangle has 3 indices

        // Set the vertex positions (in local space)
        vertices[0] = new Vector3(0, 0, 0);
        vertices[1] = new Vector3(0, 20, 0);
        vertices[2] = new Vector3(20, 20, 0);

        // Set UV coordinates corresponding to each vertex
        uv[0] = new Vector2(0, 0);
        uv[1] = new Vector2(0, 1);
        uv[2] = new Vector2(1, 1);

        // Define the order of vertices to form the triangle
        triangles[0] = 0;
        triangles[1] = 1;
        triangles[2] = 2;

        // Assign the arrays to the mesh
        mesh.vertices = vertices;
        mesh.uv = uv;
        mesh.triangles = triangles;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Visual Output: What Our Custom Mesh Looks Like in Unity&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fni3tij7rxyfgshal7yow.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fni3tij7rxyfgshal7yow.webp" alt=" " width="800" height="519"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Now It’s Your Turn!
&lt;/h2&gt;

&lt;p&gt;Now that you understand the basics of creating a mesh through scripting — using vertices, UVs, and triangles. Go ahead and experiment with differe nt shapes! Try building quads, pentagons, or even more complex forms. Play around with vertex positions, texture mappings, and triangle orders to see how each change affects the result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdkkovldod0lxqenvuvjw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdkkovldod0lxqenvuvjw.gif" alt=" " width="720" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have fun, and don’t be afraid to get creative!&lt;/p&gt;

&lt;p&gt;Find My Demo Project &lt;a href="https://github.com/prasanthse/Unity-Mesh.git" rel="noopener noreferrer"&gt;Here&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Stay updated with the latest insights and tutorials by following me on &lt;a href="https://www.linkedin.com/in/prasanthse1996" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. For any inquiries for games or questions, feel free to reach out to me via &lt;a href="//prasanth15sp@gmail.com"&gt;email&lt;/a&gt;. I’m here to assist you with any queries you may have!&lt;/p&gt;

&lt;p&gt;Don’t miss out on future articles and game development tips!&lt;/p&gt;

</description>
      <category>unitymesh</category>
      <category>meshrenderer</category>
      <category>vertexai</category>
      <category>uv</category>
    </item>
    <item>
      <title>Unity Physics Body Types</title>
      <dc:creator>Sivakumar Prasanth</dc:creator>
      <pubDate>Fri, 13 Feb 2026 10:24:36 +0000</pubDate>
      <link>https://forem.com/prasanth_sivakumar/unity-physics-body-types-3l8p</link>
      <guid>https://forem.com/prasanth_sivakumar/unity-physics-body-types-3l8p</guid>
      <description>&lt;p&gt;In game development, realism isn’t just about stunning visuals. It’s also about how objects behave in the world. Unity’s physics engine plays a key role in bringing these interactions to life.&lt;/p&gt;




&lt;h2&gt;
  
  
  Static Bodies
&lt;/h2&gt;

&lt;p&gt;Static bodies are completely immobile. Once placed in the scene, they stay fixed in position and rotation. They don’t respond to forces or collisions. But other objects can collide with them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Characteristics&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No Rigidbody required in 3D (collider alone is enough)&lt;/li&gt;
&lt;li&gt;Use Rigidbody2D with bodyType = Static in 2D &lt;/li&gt;
&lt;li&gt;Ideal for: walls, floors, terrain, or background structures &lt;/li&gt;
&lt;li&gt;Optimised for performance. Unity doesn’t have to recalculate their position&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F369xxoytyot9ww68fkhs.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F369xxoytyot9ww68fkhs.gif" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Kinematic Bodies
&lt;/h2&gt;

&lt;p&gt;Kinematic bodies don’t respond to physics forces or collisions themselves, but they can still affect Dynamic bodies if they move into them. They’re moved through scripting (e.g., by changing transform.position or setting velocity).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Characteristics&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set isKinematic = true on Rigidbody (3D)&lt;/li&gt;
&lt;li&gt;Set bodyType = Kinematic on Rigidbody2D (2D) &lt;/li&gt;
&lt;li&gt;Not affected by gravity or collisions &lt;/li&gt;
&lt;li&gt;Useful for: elevators, doors, conveyor belts, or moving platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo9tp1f0z21n1x5jsgxiy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo9tp1f0z21n1x5jsgxiy.gif" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Dynamic Bodies
&lt;/h2&gt;

&lt;p&gt;Dynamic bodies are fully simulated by the physics engine. They respond to gravity, forces, collisions, and other physical interactions. These are the most “alive” objects in your scene.&lt;/p&gt;

&lt;p&gt;Key Characteristics: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Requires Rigidbody (3D) or Rigidbody2D (2D)&lt;/li&gt;
&lt;li&gt;Use bodyType = Dynamic for 2D &lt;/li&gt;
&lt;li&gt;Reacts to AddForce, velocity, mass, and friction &lt;/li&gt;
&lt;li&gt;Ideal for: players, enemies, falling crates, or any object that moves physically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvm8pp98in7parh7g8dt7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvm8pp98in7parh7g8dt7.gif" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn6rovsqs05fxtp1ujd0u.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn6rovsqs05fxtp1ujd0u.gif" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Choosing the Right Type &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use Static for anything that never moves &lt;/li&gt;
&lt;li&gt;Use Dynamic when you want full physics interaction &lt;/li&gt;
&lt;li&gt;Use Kinematic when you need scripted or manual movement without physics influence&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Stay updated with the latest insights and tutorials by following me on &lt;a href="https://www.linkedin.com/in/prasanthse1996" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. For any inquiries for games or questions, feel free to reach out to me via &lt;a href="//prasanth15sp@gmail.com"&gt;email&lt;/a&gt;. I’m here to assist you with any queries you may have!&lt;/p&gt;

&lt;p&gt;Don’t miss out on future articles and game development tips!&lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>unityphysics</category>
      <category>unitycolliders</category>
      <category>unityrigidbody</category>
    </item>
    <item>
      <title>Unity for Animators: A Step-by-Step Breakdown of the Film Production Pipeline</title>
      <dc:creator>Sivakumar Prasanth</dc:creator>
      <pubDate>Thu, 12 Feb 2026 02:39:15 +0000</pubDate>
      <link>https://forem.com/prasanth_sivakumar/unity-for-animators-a-step-by-step-breakdown-of-the-film-production-pipeline-60m</link>
      <guid>https://forem.com/prasanth_sivakumar/unity-for-animators-a-step-by-step-breakdown-of-the-film-production-pipeline-60m</guid>
      <description>&lt;p&gt;In today’s fast-evolving world of digital storytelling, animation is no longer confined to traditional tools and linear pipelines. With the rise of real-time engines, studios are now exploring faster, more flexible, and more collaborative workflows. &lt;/p&gt;

&lt;p&gt;Unity, a game engine known for its power in interactive content, has rapidly become a favourite in the animation and film industries, not just for previews, but for full-fledged production. This blog takes you through a step-by-step breakdown of the film production pipeline from storyboarding to final compositing and explores how Unity fits into each stage.&lt;/p&gt;

&lt;p&gt;Let’s dive into the pipeline and see how Unity is bridging the gap between creativity and technology like never before.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff12nxihiqjg0w4oanhrw.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff12nxihiqjg0w4oanhrw.webp" alt=" " width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This pipeline shows the stages from story conception to the final rendered film or animation, where Unity can be used as a real-time engine to accelerate, preview, or replace traditional rendering steps.&lt;/p&gt;




&lt;h2&gt;
  
  
  Story
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The foundation of the animation or film. &lt;/li&gt;
&lt;li&gt;Involves scriptwriting, storyboarding, and defining the narrative structure.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fykaszfn9vgvysxgv2h54.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fykaszfn9vgvysxgv2h54.webp" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Art
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Concept art, character design, and environment art are created. &lt;/li&gt;
&lt;li&gt;Sets the visual tone and style.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsqca1ezf00a7inwr84s.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsqca1ezf00a7inwr84s.webp" alt=" " width="800" height="525"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Editorial
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Combines storyboards or animatics to build a rough cut or visualisation. &lt;/li&gt;
&lt;li&gt;Unity can be used here for real-time pre-visualisation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxwy0b4yo4c2g5lt9oj3.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxwy0b4yo4c2g5lt9oj3.webp" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Modeling
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;3D assets (characters, props, environments) are created using tools like &lt;a href="https://www.blender.org/" rel="noopener noreferrer"&gt;Blender&lt;/a&gt;, &lt;a href="https://www.autodesk.com/products/maya/overview" rel="noopener noreferrer"&gt;Autodesk Maya&lt;/a&gt;, &lt;a href="https://www.foundry.com/news-and-awards/foundry-winds-down-modo-development" rel="noopener noreferrer"&gt;Modo&lt;/a&gt; or &lt;a href="https://www.cheetah3d.com/" rel="noopener noreferrer"&gt;Cheetah3D&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;Assets are exported in any of the &lt;a href="https://docs.unity3d.com/6000.1/Documentation/Manual/3D-formats.html" rel="noopener noreferrer"&gt;Unity support format&lt;/a&gt; and can be imported into Unity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjtn15olgfwzgofgh4mmx.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjtn15olgfwzgofgh4mmx.webp" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Rigging
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Bones and control rigs are added to characters and objects. &lt;/li&gt;
&lt;li&gt;These are what animators use to pose or animate characters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftajp6h4jrtjej95c1kbq.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftajp6h4jrtjej95c1kbq.webp" alt=" " width="800" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Animation
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Characters and objects are animated using keyframe animation or motion capture. &lt;/li&gt;
&lt;li&gt;Unity supports importing animated rigs and editing animations via the Animation window or Timeline.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F336gn0jbnvt7f0b3oxyj.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F336gn0jbnvt7f0b3oxyj.webp" alt=" " width="800" height="213"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Crowds
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Systems for animating large groups (e.g., background characters or armies). &lt;/li&gt;
&lt;li&gt;Unity supports crowd simulations using tools or custom AI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fys6n7yr5z6fat3ec5j51.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fys6n7yr5z6fat3ec5j51.webp" alt=" " width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Layout
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Sets up camera positions, blocking, and rough animations. &lt;/li&gt;
&lt;li&gt;This stage ensures visual storytelling is clear before final polish. &lt;/li&gt;
&lt;li&gt;Unity’s Timeline and Cinemachine are powerful tools here.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6ykqsoxhx0aafjph2xp.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6ykqsoxhx0aafjph2xp.webp" alt=" " width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Surfacing
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Applies materials and textures to models. &lt;/li&gt;
&lt;li&gt;Unity’s Shader Graph and HDRP offer film-quality surfacing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fri4s3e01jjlj0gfal3zi.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fri4s3e01jjlj0gfal3zi.webp" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Character FX
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Includes things like hair dynamics, cloth simulation, muscle jiggle. &lt;/li&gt;
&lt;li&gt;Unity supports real-time simulations or baked effects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxrvw9lhgezf8n1ugs1y.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxrvw9lhgezf8n1ugs1y.gif" alt=" " width="550" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FX (Effects)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Visual effects like fire, smoke, magic, water. &lt;/li&gt;
&lt;li&gt;In Unity, these can be done using the VFX Graph or Particle System.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi058fxfjoxwxm16o5ai7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi058fxfjoxwxm16o5ai7.gif" alt=" " width="600" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Lighting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Establishes mood and visibility using light placement and environment lighting. &lt;/li&gt;
&lt;li&gt;Unity supports physically based lighting, global illumination, and real-time rendering.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsp2jivmyuod8ailfbgs0.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsp2jivmyuod8ailfbgs0.webp" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Matte Painting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;2D/3D background art. &lt;/li&gt;
&lt;li&gt;Can be projected into Unity scenes for fast environment setup.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnhejr4d2gotuueq079y1.webp" alt=" " width="800" height="450"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Compositing
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Combines all renders (characters, FX, backgrounds) into the final image. &lt;/li&gt;
&lt;li&gt;In Unity, this can be partly real-time using post-processing effects or done in external software.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbnabs0ib0cdc94nzobaz.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbnabs0ib0cdc94nzobaz.webp" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  How Unity Fits into This Pipeline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Real-time pre-visualisation (Story + Editorial). &lt;/li&gt;
&lt;li&gt;Asset ingestion from DCC tools (like Maya/Blender). &lt;/li&gt;
&lt;li&gt;Non-linear animation editing with Timeline + Animator. &lt;/li&gt;
&lt;li&gt;High-quality visuals using HDRP (High Definition Render Pipeline). &lt;/li&gt;
&lt;li&gt;Live rendering for scenes, helping iterate faster than traditional offline renderers. &lt;/li&gt;
&lt;li&gt;Rendering final output using Unity Recorder or USD export for compositing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Key Tools in Unity’s Asset Workflow
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;FBX/GLTF/OBJ Importers&lt;/strong&gt;: Bring in 3D models. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timeline &amp;amp; Cinemachine&lt;/strong&gt;: Animate and direct scenes. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Animator &amp;amp; Animation Window&lt;/strong&gt;: Control character animations. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shader Graph&lt;/strong&gt;: Create high-end materials. V&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FX Graph &amp;amp; Particle System&lt;/strong&gt;: Build dynamic visual effects. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HDRP&lt;/strong&gt;: Film-quality lighting and visuals. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unity Recorder&lt;/strong&gt;: Capture sequences for compositing or editing.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Unity supports film and animation pipelines by providing a real-time platform to: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Speed up iteration. &lt;/li&gt;
&lt;li&gt;Preview scenes live. &lt;/li&gt;
&lt;li&gt;Reduce rendering times. &lt;/li&gt;
&lt;li&gt;Integrate assets from traditional tools. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It complements or even replaces parts of traditional pipelines, especially for studios looking to cut down post-production time.&lt;/p&gt;




&lt;p&gt;Stay updated with the latest insights and tutorials by following me on &lt;a href="https://www.linkedin.com/in/prasanthse1996" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. For any inquiries for games or questions, feel free to reach out to me via &lt;a href="//prasanth15sp@gmail.com"&gt;email&lt;/a&gt;. I’m here to assist you with any queries you may have!&lt;/p&gt;

&lt;p&gt;Don’t miss out on future articles and game development tips!&lt;/p&gt;

</description>
      <category>animation</category>
      <category>animationpipeline</category>
      <category>unity3d</category>
      <category>filmproductionanimation</category>
    </item>
    <item>
      <title>The Great Debate: Rigidbody vs Character Controller for Player Movement in Unity</title>
      <dc:creator>Sivakumar Prasanth</dc:creator>
      <pubDate>Wed, 11 Feb 2026 05:12:30 +0000</pubDate>
      <link>https://forem.com/prasanth_sivakumar/the-great-debate-rigidbody-vs-character-controller-for-player-movement-in-unity-1d61</link>
      <guid>https://forem.com/prasanth_sivakumar/the-great-debate-rigidbody-vs-character-controller-for-player-movement-in-unity-1d61</guid>
      <description>&lt;p&gt;When it comes to player movement in Unity, one question continues to spark debate among developers: &lt;strong&gt;Should I use a Rigidbody or a Character Controller?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this blog, we’ll dive deep into the differences between Rigidbody and CharacterController components, how they behave, when to use them, and the challenges they present. By the end, you’ll have a clearer picture of which system suits your project best and why this decision can significantly impact your gameplay feel and performance.&lt;/p&gt;




&lt;h2&gt;
  
  
  Character Controller
&lt;/h2&gt;

&lt;p&gt;The CharacterController is a built-in Unity component designed for player controlled movement without using full physics simulation. It doesn’t use Rigidbody forces, instead, you move it using the Move() or SimpleMove() functions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rigidbody (Dynamic)
&lt;/h2&gt;

&lt;p&gt;A Dynamic Rigidbody is a physics driven object. It reacts to forces, collisions, and gravity. This is Unity’s full-fledged physics simulation component.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rigidbody (Kinematic)
&lt;/h2&gt;

&lt;p&gt;A Kinematic Rigidbody means the object has a Rigidbody component, but physics won’t affect it (e.g., no gravity, no automatic response to collisions). Instead, you control its motion manually.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Affected by Gravity / Physics Interactions&lt;/strong&gt; &lt;br&gt;
❌ Character Controller (Need to handle via script)&lt;br&gt;
✅ Rigidbody - Dynamic&lt;br&gt;
❌ Rigidbody - Kinematic&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuukuij31kn5xelt9zsl2.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuukuij31kn5xelt9zsl2.gif" alt=" " width="760" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Collision Detection&lt;/strong&gt; &lt;br&gt;
✅ Character Controller &lt;br&gt;
✅ Rigidbody - Dynamic &lt;br&gt;
❌ Rigidbody - Kinematic (They can be used to trigger events when they overlap with other colliders) &lt;/p&gt;

&lt;p&gt;&lt;em&gt;You must add a Collider manually in Rigidbody but no external collider is required for Character controller hence the Character Controller component includes a built-in Capsule Collider.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frfnnfy3sknz831jdw4z8.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frfnnfy3sknz831jdw4z8.gif" alt=" " width="720" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Slope Traversal / Stair Handling&lt;/strong&gt;&lt;br&gt;
✅ Character Controller (Build-in) &lt;br&gt;
❌ Rigidbody — Dynamic (Needs custom logic) &lt;br&gt;
❌ Rigidbody — Kinematic&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffr62urrrg2hlm1ud0tr6.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffr62urrrg2hlm1ud0tr6.gif" alt=" " width="760" height="427"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Best For
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Character Controller&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FPS or third-person controllers &lt;/li&gt;
&lt;li&gt;Smooth, responsive movement &lt;/li&gt;
&lt;li&gt;Games where fine-tuned control is more important than realistic physics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Character controller is best for snappy movement (A movement style in games that feels fast, responsive, and immediate, with minimal delay or momentum).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Character Controller Wins for Snappy Movement:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Direct, Immediate Movement&lt;/strong&gt;: You move using Move() or SimpleMove(), which gives instant control with no delay or inertia. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No Physics Overhead&lt;/strong&gt;: It bypasses Unity’s physics system, so you’re not fighting against forces, drag, or unwanted sliding. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistent and Predictable&lt;/strong&gt;: Your player moves the same way every time, regardless of frame rate, slope, or surface type. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Built-in Slope and Step Handling&lt;/strong&gt;: It handles climbing small steps and walking up slopes without custom logic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Rigidbody is Trickier for Snappy Movement:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rigidbody.velocity can work, but it’s sensitive to: Gravity, Friction/drag and Bouncing on collision &lt;/li&gt;
&lt;li&gt;Using AddForce() is not snappy. It introduces momentum and delay unless carefully tuned.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Exceptions:&lt;/strong&gt;&lt;br&gt;
If you need physics interactions (e.g., knockbacks, bouncing, pushing objects), a Rigidbody with velocity control can still work. But requires more effort to feel “snappy.”&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Rigidbody - Dynamic&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Objects needing realistic physics (e.g., rolling, bouncing, falling) &lt;/li&gt;
&lt;li&gt;Platformers, puzzle games, or any physics based gameplay &lt;/li&gt;
&lt;li&gt;Multiplayer physics interactions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Dynamic Rigidbody is best for momentum based movement (A movement style in games where characters or objects behave with realistic inertia, meaning their mass, speed, and previous velocity affect how they start, stop, and change direction just like in the real world).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Rigidbody Is Best for Momentum-Based Movement:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real Physics Simulation&lt;/strong&gt;: Rigidbody is built to simulate real-world motion: acceleration, deceleration, inertia, gravity, and mass all affect how the object moves. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Natural Momentum&lt;/strong&gt;: Using Rigidbody.AddForce() or AddRelativeForce() allows movement to build up and decay over time, creating realistic sliding, drifting, or weighty motion. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supports Collisions &amp;amp; Physical Reactions&lt;/strong&gt;: It interacts properly with other physics objects, bouncing, pushing, and reacting naturally. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adjustable Through Physics Settings&lt;/strong&gt;: You can tune mass, drag, and angular drag to get the exact momentum feel you want.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Character Controller Doesn’t Fit:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CharacterController uses manual, non-physics-based movement.&lt;/li&gt;
&lt;li&gt;It doesn’t simulate momentum. Movement starts and stops immediately. &lt;/li&gt;
&lt;li&gt;You’d have to fake momentum yourself using custom variables and logic.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Rigidbody — Kinematic&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Moving platforms &lt;/li&gt;
&lt;li&gt;Cutscene objects &lt;/li&gt;
&lt;li&gt;Controlled AI agents that need to interact with physics objects but aren’t affected by them&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;When it comes to creating movement that feels natural, weighty, and physically responsive, Rigidbody based movement is the clear choice. Its built-in physics simulation gives you momentum “for free,” enabling acceleration, deceleration, and realistic reactions to forces all essential ingredients for immersive gameplay.&lt;/p&gt;

&lt;p&gt;While the Character Controller shines in tight, snappy movement systems, it falls short when momentum and physics-based interactions are critical.&lt;/p&gt;

&lt;p&gt;If your game involves sliding, drifting, inertia, or physically-reactive characters, a dynamic Rigidbody setup is your best bet. Ultimately, your choice depends on your game’s feel, style, and player experience goals but for momentum based movement, Rigidbody wins with physics on its side.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/prasanthse/Unity-Animations" rel="noopener noreferrer"&gt;Check out the demo project on GitHub&lt;/a&gt; &lt;br&gt;
Includes a simple Unity scene showcasing Rigidbody vs Character controller.&lt;/p&gt;




&lt;p&gt;Stay updated with the latest insights and tutorials by following me on &lt;a href="https://www.linkedin.com/in/prasanthse1996/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. For any inquiries for games or questions, feel free to reach out to me via &lt;a href="//prasanth15sp@gmail.com"&gt;email&lt;/a&gt;. I’m here to assist you with any queries you may have!&lt;/p&gt;

&lt;p&gt;Don’t miss out on future articles and game development tips!&lt;/p&gt;

</description>
      <category>rigidbody</category>
      <category>charactercontroller</category>
      <category>unityphysics</category>
      <category>playermovement</category>
    </item>
  </channel>
</rss>
