/r/Unity2D
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.
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.
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
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
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;
}
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:
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.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:
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.
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!
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
Driving up to the first level!
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!
I'm using Tilemaps. When the camera is moving, I have these weird lines between my tiles.
Any Ideas what this is?
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 ;)
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)
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:
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:
Based on ChatGPT’s recommendations, here’s a quick breakdown of the MVP scope and estimated 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.
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.
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()
{
}
}
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?
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 ?
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.
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
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
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:
Play the Early Access by clicking this link.
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;
}
}
}