/r/Unity2D

Photograph via snooOG

This is a subreddit for 2D or 2.5D game developers using the proprietary Unity game engine. New and experienced Unity developers alike should first consider using the free and open source Godot engine by default and ONLY choose Unity for 2D development if Godot isn't capable of the task. The times are quickly changing, and Godot is on track to surpass Unity for small developers.

About

This is a subreddit for 2D or 2.5D game developers using the proprietary Unity game engine. New and experienced Unity developers alike should first consider using the free and open source Godot engine by default and ONLY choose Unity for 2D development if Godot isn't capable of the task. The times are quickly changing, and Godot is on track to surpass Unity for small developers.

Getting Started


Godot Features

Download Godot

Godot Docs

Download Unity

Unity Manual

Official Reference

Asset Store

Software

Related Communities

/r/Godot - The "Unity Killer". A fully free and open source engine making astonishing leaps and bounds.

/r/UnityAssets - Share asset packs!

/r/PixelArt - Admire, share, and observe beautiful pixel art.

/r/GameDev - Meet and communicate with other game developers.

/r/GameDesign - Don't just make a game. Make a good game.

/r/LevelDesign - Learn to make excellent levels and worlds.

/r/GameAudio - It may look good, but does it sound good?


CSS created by Sean O'Dowd @nicetrysean [Website]

/r/Unity2D

160,395 Subscribers

1

Working on my first Steam game! Do you want to try the demo? Kickstarter coming soon!

Hello!

This is my first game, Big Boy Adventure: a Top-Down Story driven RPG.
After so much hard work, the demo of my first indie game is finally out! 🎮 Do you want to try it?
Steam page: https://store.steampowered.com/app/3365380/Big_Boy_Adventure/

I'll be launching the kickstarter in 2 days... By following the page you help me a lot in the development of the game: https://www.kickstarter.com/projects/maiokgames/big-boy-adventure-pixel-indie-game

Thank you all <3

0 Comments
2025/02/04
11:37 UTC

2

I added chests to the dungeon. Yippie

0 Comments
2025/02/04
11:09 UTC

3

I just released "Berserk High" as Action RPG. Unity is good engine to develop 2d Game actually.

1 Comment
2025/02/04
07:41 UTC

3

URP Pixel Perfect Camera + Cinemachine Shaking - Unity 6000.0.34f1

TLDR; How do I make smooth movement and prevent the player object and UI from shaking when using the Pixel Perfect Camera with the URP?

Player Shaking

I've implemented the Pixel Perfect Camera and it causes the player game object to shake. You can see as the player walks there's a slight shake, and when they stop they shake as the camera catches up to them. If I turn off damping it helps a little, but it'd be nice to be able to keep it.

Here's an example of the player walking with Damping set to 1.

Shaky Walking and UI Video Link

I'm thinking it has got to be something with how I'm moving the player but not sure. Here's a code example of how I'm having the player walk.

// Using the newer input system I get the input and store it into a motion vector   
private void Update() {
    motionVector = GetMoveDirection().normalized;
}  

// Every frame I set the linearVelocity to the new motionVector with a speed 
private void FixedUpdate() {
    rb.linearVelocity = speed * Time.deltaTime * motionVector;
}

I found a few tutorials online and tried to adjust the movement so that the player only moved one whole pixel at a time using position instead of linearVelocity, but it didn't seem to work. Here's an example:

rb.position = PixelPerfectClamp(rb.position);

Vector2 PixelPerfectClamp(Vector2 rbPosition, float pixelsPerUnit = 16) {
    // Round the position to the nearest pixel
    Vector2 pixelPerfectPosition = new Vector2(
        Mathf.RoundToInt(rbPosition.x * pixelsPerUnit) / pixelsPerUnit,
        Mathf.RoundToInt(rbPosition.y * pixelsPerUnit) / pixelsPerUnit
    );

    // Update the position
    return pixelPerfectPosition;
}

UI Shaking

The UI shakes as the player moves because the camera is following the player. I've tried the following things and none of them have worked:

  1. Set the canvas to Screen Space - Overlay. This doesn't work because I'm using the Pixel Perfect Camera crop mode to maintain a 4:3 aspect ratio. If I use overlay then the UI doesn't stay within the Pillarboxing/Letterboxing.
  2. Use a separate overlay camera to render the UI and add it to the Main Camera's stack. This doesn't work because the Pixel Perfect Camera doesn't support camera stacking.
  3. Use a Shader and Material to put on the UI elements to remove shaking. I don't know anything about shaders and pulled this from the internet. So this was a long shot. Here's the shader:
Shader "Unlit/RemoveShakeForUI"
{
    Properties
    {
        [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
        _Color ("Tint", Color) = (1,1,1,1)
    }
    SubShader
    {
        Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #include "UnityCG.cginc"

            struct appdata_t
            {
                float4 vertex : POSITION;
                float2 uv : TEXCOORD0;
            };

            struct v2f
            {
                float2 uv : TEXCOORD0;
                float4 vertex : SV_POSITION;
            };

            sampler2D _MainTex;
            float4 _Color;

            v2f vert (appdata_t v)
            {
                v2f o;
                o.vertex = UnityObjectToClipPos(v.vertex);
                // Round to nearest pixel
                o.vertex.xy = round(o.vertex.xy * _ScreenParams.xy) / _ScreenParams.xy;
                o.uv = v.uv;
                return o;
            }

            fixed4 frag (v2f i) : SV_Target
            {
                return tex2D(_MainTex, i.uv) * _Color;
            }
            ENDCG
        }
    }
}

I'm hoping that if I can figure out how to get the player to stop shaking, then I'll be able to apply the same logic to the UI elements. Hopefully it's that simple :)

Here are my Canvas and Pixel Perfect Camera settings:

Canvas Settings Image

Pixel Perfect Camera Settings Image

2 Comments
2025/02/04
03:46 UTC

1

Issue loading a prefab

Hello,

I'm basically making a game for myself in order to learn unity. As I've gone down this path I've discovered there are some assets I want to load on the fly. One of these is the player character (a tank) and also enemy tanks.

I noticed my player tank is missing its health bar, but that only happens when loaded via script.

If I drag the prefab into the hierarchy (which then loads 2 at runtime) the tank that that exists in the hierarchy has it's health bar. Also, if I pause the game and look at the Scene tab, I can see the health bar. Images follow.

In Game mode

In Scene mode

Hierarchy on left, loaded at runtime on right

The code I use to load the player:

public void spawnPlayer()

{

Vector3 rangeX, random1;

Vector3 rangeY;

GameObject playerPrefab;

playerPrefab = Resources.Load<GameObject>("nPrefabs/Player");

GameObject playerTank;

rangeX = new Vector3(-26, -26, 0);

rangeY = new Vector3(0, -100, 0);

random1 = new Vector3(Random.Range(rangeX.x, rangeX.y), Random.Range(rangeY.x, rangeY.y), 0);

playerTank = Instantiate(playerPrefab, random1, Quaternion.identity);

}

(Sorry, reddit would not let me paste a proper code block)

Any ideas? Thanks!

2 Comments
2025/02/04
00:34 UTC

0

Los colores de mi Sprite 2d de Unity no son los correctos

Los colores de este sprite no son los correctos, la imagen 1 es el diseño de como se deberia ver, la imagen 2 es como me aparece en unity.

Porfavor alguien ayudeme, es urgente

https://preview.redd.it/5giwtu9oy0he1.png?width=693&format=png&auto=webp&s=a244d5c0e9ad70efdf2380a2f01e724eb0442fd4

https://preview.redd.it/wlb84wcpy0he1.png?width=615&format=png&auto=webp&s=d978b4821bb2006af543411ad2ebcefd648ee27a

8 Comments
2025/02/04
00:04 UTC

6

En Route

Driving up to the first level!

0 Comments
2025/02/03
23:43 UTC

3

I made a file explorer tool in unity

I Created a Windows Explorer for Unity!

I recently built a tool that lets you browse and manage external folders directly inside Unity—no more being stuck inside the Project window! I initially made this for myself, but I figured others might find it useful too.

🚀 External Directory Manager

✔️ Manage External Folders & Files in Unity

✔️ Pin Favorite Directories for Quick Access

✔️ Preview Images & Import Files Seamlessly

Coming from a background as a professional music producer who relied on Ableton Live, I always found it bizarre that Unity lacked a proper directory browser like Ableton’s. I wanted the ability to pin folders, browse files from anywhere on local storage, and easily bring them into my project—so I built it!

Any feedback, feature requests, or even pricing suggestions would be hugely appreciated—this is my first Unity Asset Store release, and I’d love to hear your thoughts!

External Directory Manager

2 Comments
2025/02/03
23:25 UTC

22

2000 wishlists in under a month! I can’t believe that’s 2000 people interested something so niche like a cozy horror game – it’s honestly overwhelming in the best way. (╥﹏╥)

1 Comment
2025/02/03
22:34 UTC

1

4 Comments
2025/02/03
22:10 UTC

1

I need serious criticism of my steam page.

I'm getting a lot of visits but no wishlists. Can you please take a few minutes to review the page and let me know what I can do to improve it. I would appreciate the criticism.

https://store.steampowered.com/app/3272020/Rust_Runners/

Wishlist if you want also ;)

4 Comments
2025/02/03
22:05 UTC

0

I am having a hard time moving game objects, could anyone help?

https://preview.redd.it/u06ehl2iizge1.png?width=848&format=png&auto=webp&s=18b346ef79b8d41d673d1a6783999d3aed236997

https://preview.redd.it/3w2u5gplizge1.png?width=1506&format=png&auto=webp&s=521520d9f0e590e18fc27060aa7448f0831d525f

Please help, is this so wrong? I am VERY new to Unity and I am losing my mind even just trying to get the player and camera over to another scene. I know that it isn't perfect, I am doing an Independent Study for university and I am learning piece by piece. But how close/can anyone else me just being able to get these into another scene? Any pointers...thank you (T-T)

6 Comments
2025/02/03
20:36 UTC

0

30, taking the leap into game dev – need advice on budget & roadmap building a small multiplayer world

Hey everyone,

I've been in and around the gaming industry for a long time, but never on the development side until now. I started working at gaming expos when I was 15, ran my own gaming review site for years, and have always been deeply into the community-driven side of games. My actual background is in motion design and project management, so while I’m not a game developer, I understand workflows, tools, and how to structure a project.

Lately, I’ve been nostalgic for games like Habbo Hotel, Club Penguin, and Sanalika—those small, social, multiplayer spaces that felt like little online worlds. I want to build something in that vein, but way more minimal to start. My idea is a simple multiplayer game where players can:

  • Log in (no chat, just a safe, parent-controlled environment).
  • Spawn into a small 10-player server.
  • Customize their avatar with a couple of accessories.
  • Walk around a single map with one extra indoor area.

I know this is a huge undertaking, and I don’t expect to do it all myself. I’ve started learning Unity and C#, and I can handle some of the 2D asset creation. I also have some friends who might be willing to help here and there. A while back, I even built a tiny 2D game as a gift for my fiancée, so I’ve dabbled in small-scale projects before.

Budget & Realistic Expectations

I have $5,000 $10,000 to invest initially, and I want to be smart about how I spend it. I know that’s not much in the grand scheme of things, but I’m serious about making this work.

So, I’m looking for advice on:

What’s realistically possible with this budget?

How much should I expect to pay for a basic multiplayer prototype (assuming I hire a Unity dev + an artist for what I can’t do myself)?

Would starting with WebGL make more sense before moving to mobile/Steam?

Any tips on structuring the project to get the most out of a small budget?

I’m fully aware this will take time and won’t be easy, but I’m at a point where I want to take the risk and start something of my own. Any insight from indie devs, studio owners, or anyone who’s worked on something similar would be massively appreciated!

---

Here is chatgpt summary of my questions all questions:

ChatGPT’s Summary & Budget Estimate

Based on ChatGPT’s recommendations, here’s a quick breakdown of the MVP scope and estimated costs:

  • Tech Stack: Unity (C#), Photon Fusion/Mirror for multiplayer, PlayFab/Firebase for backend.
  • Development ($3K–$6K): Freelance Unity dev for core gameplay, multiplayer, and UI.
  • 2D Assets ($500–$2K): Custom or asset store-based character, accessories, and a single map.
  • Backend & Database ($500–$1.5K): PlayFab free tier or custom backend if needed.
  • WebGL Deployment ($500–$1K, optional): Optimize for browser before moving to mobile/Steam.
  • Miscellaneous ($500–$1K): Playtesting, hosting, and unexpected costs.

Total Estimate: $5K–$10K for an MVP.
Strategy: Start small, test early, use free assets where possible, and scale later. 🚀

I didn't tell my budget while asking and it was incognito tab chat but she estimated its around 10k$ anyway but I don't know these prices are reliable.

4 Comments
2025/02/03
20:22 UTC

1

🌸 Discovering what Crystal Art is most effective against your foe is half the fun when playing LUCID 🌸

1 Comment
2025/02/03
19:35 UTC

0

Help me (Save/load Transform issue )

Hello, I have no issues in the Unity editor, but when I build the game for iPhone, the cards I place in the game are saved correctly. However, when I close and reopen the game, the cards spawn in incorrect positions after loading, and they don’t even appear on the screen. This issue does not occur in the Unity editor at all, so I can’t figure out exactly what’s causing it. Please help.

https://preview.redd.it/ceusxwm62zge1.jpg?width=1585&format=pjpg&auto=webp&s=35ea3d4e592390ea1319a61d77080279aef60c85

https://preview.redd.it/gf7a6ym62zge1.jpg?width=1610&format=pjpg&auto=webp&s=6e1d74f7a7fe1fea3165033c7d3413bd26f5bed8

1 Comment
2025/02/03
19:05 UTC

1

Rhythm game code can't hit notes

I followed a tutorial on how to make a rhythm game note code and where the note can be hit is controlled by return noteTapY - (noteSpawnY - noteTapY); which makes it so the notes can be hit at the bottom of the screen, however I need it to be the notes can only be hit when there's a collision with a player gameObject instead. It is using the dryWetMidi package so I'm not sure if that changes what is possible. Here's the full code: using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using Melanchall.DryWetMidi.Core;

using Melanchall.DryWetMidi.Interaction;

using System.IO;

using UnityEngine.Networking;

public class SongManager : MonoBehaviour

{

public static SongManager Instance;

public AudioSource audioSource;

public Lane[] lanes;

public float songDelayInSeconds;

public double marginOfError; //in seconds

public int inputDelayInMilliseconds;

public string fileLocation;

public float noteTime;

public float noteSpawnY;

public float noteTapY;

public GameObject Player;

public GameObject Note;

public float noteDespawnY

{

get

{

return noteTapY - (noteSpawnY - noteTapY);

}

}

public static MidiFile midiFile;

// Start is called before the first frame update

void Start()

{

Instance = this;

if (Application.streamingAssetsPath.StartsWith("http://") || Application.streamingAssetsPath.StartsWith("https://"))

{

StartCoroutine(ReadFromWebsite());

}

else

{

ReadFromFile();

}

}

private IEnumerator ReadFromWebsite()

{

using (UnityWebRequest www = UnityWebRequest.Get(Application.streamingAssetsPath + "/" + fileLocation))

{

yield return www.SendWebRequest();

if (www.isNetworkError || www.isHttpError)

{

Debug.LogError(www.error);

}

else

{

byte[] results = www.downloadHandler.data;

using (var stream = new MemoryStream(results))

{

midiFile = MidiFile.Read(stream);

}

}

}

}

private void ReadFromFile()

{

midiFile = MidiFile.Read(Application.streamingAssetsPath + "/" + fileLocation);

GetDataFromMidi();

}

public void GetDataFromMidi()

{

var notes = midiFile.GetNotes();

var array = new Melanchall.DryWetMidi.Interaction.Note[notes.Count];

notes.CopyTo(array, 0);

foreach (var lane in lanes) lane.SetTimeStamps(array);

Invoke(nameof(StartSong), songDelayInSeconds);

}

public void StartSong()

{

audioSource.Play();

}

public static double GetAudioSourceTime()

{

return (double)Instance.audioSource.timeSamples / Instance.audioSource.clip.frequency;

}

// Update is called once per frame

void Update()

{

}

}

0 Comments
2025/02/03
19:05 UTC

1

Mixed top down perspective?

I have a train game where the user will drive trains from a TRUE top down perspective. The train, tracks, and cars will all be like that. It needs to be that way because they can travel in any direction. However, I have some good assets (buildings/tress etc) that traditional top down perspective, think Pokemon games.

Would it be jarring to have a mix of those perspectives, or would it not be that big of a deal?

1 Comment
2025/02/03
17:51 UTC

1

Unity Simple Tournament System for 3D and 2D games

1 Comment
2025/02/03
15:33 UTC

8

I am making a metroidvania, is it a good idea ?

Alright so I have been working on a 2D top down game with Unity for over a year now. I don't have a steam page yet and I want to gather feedback on the current game state to see if it could be a good idea to create the steam page now !

The game is called subrunner and is about a ninja hacker living in SUBCITY, a cyberpunk underground city that looks like a labyrinth the ninja wants to eat ramen but there is no ramen left in the fridge omg !!
it is time to go to UPCITY at the ramen store !! this is your mission but beware of lost cyberzombies and droids on the way...

I have made a little demo video on the current prototype (working on shadows and level ambiance) : https://www.youtube.com/watch?v=X7XBpY1-lzI

On this demo video you can see some combat mechanics (attack, dodge), but a big part of the gameplay will concern hacking (since the Zombos are cyberzombies, they can of course be hacked !!). The hacking will be the kindof equivalent of a standard magic system with mana that we can see in a lot of games.

At first I wanted to make this game a sandbox with crafting, creating rooms mechanics and all but it will take an ENOURMOUS amount of time so my first objective is to create a metroidvania demo with 5 levels (the level in the video is the floor -4).

I know metroidvania is a overpopulated video game genre so I would like to know if it is still a good idea to make this a metroidvania or not.. do you feel like my game can bring some thing fresh of it ? Does it looks like just like a copy paste of another game ?

12 Comments
2025/02/03
15:29 UTC

1

Help with inventory save system!!

Hey guys I would appreciate any help, I know this might be an advanced problem not many could help with but I am struggling with this. I will do my best to properly explain this to the best of my abilities and provide some code.

But the issue I am having is that my inventory system for my game works like this, you get a item and it will update a script called the player stats sheet, this sheet saves data, all of that is properly saved and is not the issue.

When you pick up this item it will go to your inventory which is just a UI screen that shows the items you have equipped, it will show this via picture, string name, string description, int stack, a Boolean to tell if a item is in the slot, etc.

I am not saving the items via scriptable object on the inventory slots, the slots are ui game objects in a long list that all are image frames where the item would go in your inventory, all of these have a script called itemSlot on them, I am holding them in a list and using a for loop each time to add to them checking the Boolean if they are currently holding a item and if the item you are picking up is the same as the one on the ground.

Now long story short I am trying to save the variables on each item in the list by taking that list setting it equal to another list that is apart of the save data script, and when the game loads I use a for loop and a nested for loop which may be bad practice but I have no idea how to go through 2 list setting values equal to another.

What I am doing is going through the saved list-

for(int i = 0; i < SavedGameManager.playerData.savedItemSlots.Count; i++)

{

   for(int o = 0; o < itemSlots.Count; o++)
   {


            If(SavedGameManager.playerData.savedItemSlots[i].hasItem == true) 

{

     itemSlots[o].itemName = SavedGameManager.playerData.savedItemSlots[i].itemName; 

}

   }

}

Sry for the formatting i am on my phone and all, but that’s really the gist of what i am doing, its giving me a null reference, probably for a very obvious reason to someone else, but i just don’t know. If anyone has a solution to my problem or a better way to try and do what i am doing i am very open to solutions.

Again thank you anyone for responding and helping if you can.

6 Comments
2025/02/02
22:23 UTC

3

We're making a cute adventure game in Unity about a tiny wizard traveling throughout various islands, in search of a way to restore the fantasy world's corrupted Magic Spellbook. A perfect mix of cozy and exploration!

4 Comments
2025/02/02
15:44 UTC

1

How to prevent a player from pushing a rigidbody

I currently have a pltform that should fall, the issue is that the player can push it up from beneath which I don't want to happen

11 Comments
2025/02/02
15:24 UTC

26

The "big house" feature took two weeks to develop. Modifying the existing code along with adding new code exceeded a thousand lines, and I believe it was worth it.

10 Comments
2025/02/02
14:16 UTC

0

Crashes upon opening editor

Every time I open Unity, it crashes after finishing loading the editor. The crash happens during the loading process that occurs after the project window opens. It always stops at “Waiting for Unity’s code in UnityEditor.CoreModule.dll to finish executing.”

The top part of the loading statement varies—sometimes it says “SceneView.Repaint,” sometimes “SceneHierarchyWindow.Repaint,” and there are a few others I can’t remember.

This issue has persisted even after fully deleting and reinstalling Unity 6. It happens in every project, even new ones. The problem started in a project I had been working on for about a week, right after I installed a package via the Package Manager. I believe it was the URP package.

I’ve tried restarting my computer, but that didn’t change anything. I would really appreciate some help, as I’m new to Unity. Any assistance would be much appreciated. Thank you!

Unity discussion link more information including logs here: https://discussions.unity.com/t/crashes-upon-opening-editor/1593843

6 Comments
2025/02/02
12:01 UTC

1

Working on a psychological horror game about guilt, grief, and the darkness within.

Hey everyone!
I’m excited to share the early access of my new game, House of Haunting Memories, a psychological horror experience where you play as Josh, a man trying to escape his troubled past. But as the nights grow darker, so does his mind.

Key Features:

  • A gripping story about guilt, grief, and the consequences of unchecked despair.
  • Dual perspectives: Play as both Josh and Detective Derek, uncovering the truth from two sides.
  • Hidden secrets, cryptic puzzles, and a haunting narrative that keeps you on edge.

Play the Early Access by clicking this link.

0 Comments
2025/02/02
11:51 UTC

2

I made my first game using UNITY

0 Comments
2025/02/02
07:03 UTC

0

Hi guys, I am working on my first game just to learn but I have no idea how to restart the game on collision with the obstacles or edge of the screen.

My game is just a flappy bird knock off but I'm just making it to learn the basics and this is where I'm stuck. A relatively simple solution would be gretaly appreciated. (I have colliders set up for everything as well I'm just not sure of how to make the script.)
using UnityEngine;

public class TheFlap : MonoBehaviour

{

public float jumpForce = 5f;

private Rigidbody2D rb;

void Start(){

rb = GetComponent<Rigidbody2D>();

}

void Update() {

if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0)) {

rb.linearVelocity = Vector2.up * jumpForce;

}

}

}

1 Comment
2025/02/02
05:53 UTC

Back To Top