/r/Unity2D

Photograph via snooOG

About


/r/Unity2D is a subreddit for news, tutorials, feedback, resources, and conversations related to 2D or 2.5D game development using the Unity game engine.

If the content is not related to 2D/2.5D development, it may belong in /r/Unity3D or /r/GameDev.


Official Discord

https://discord.gg/unity


Rules


Getting Started


Unity3D on GameDevWiki

Download Unity

Official Tutorials

Live Training Archive

Live Chat/Support - Game Dev League

Official Manual

Official Reference

Asset Store

Unity 2D forums

Tutorials Filter Wiki List

Software

Resources

Unity Web Demos

Related Communities

/unity3D on 8chan - Unity-focused image board

/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

146,599 Subscribers

1

no one has answered me.

Hola comunidad. Soy peruano, conocen una pagina como domestica para aprender a hacer paginas de juegos (o APP's de Juegos para Play Store o un libro) como: FRIV, MINI JUEGOS, el juego EL BRUTO. y paginas y juegos online como: SOFTNYX, AXESO5, VFUN, etc? Los institutos que solo enseñan a crear videojuegos me salen caros y bueno, en casa no he encontrado clases específicas, sigo buscando información. Se agradece su información, gracias.

Hello community. I am Peruvian, they know a page like domestic to learn how to make game pages (or APP's of Games for Play Store or a book) such as: FRIV, MINI GAMES, the game EL BRUTO. and online pages and games such as: SOFTNYX, AXESO5, VFUN, etc? The institutes that only teach how to create video games are expensive for me and, well, in domestic I haven't found any specific classes, I'm still looking for information. Your information is appreciated, thank you.

5 Comments
2024/04/30
14:21 UTC

1

Collier doesn't detect each other.

So I just started unity one week ago. And I was following an old tutorial. Everything was fine until my first ennemy. I put rigidbody on my main caracter. Gave him a collide. But when he need to take hit from ennemy. He didn't want to.

I coded a simple "onCollisionEnter2D" But nothing works. I can hit the collider of the ennemy with my "player" But the "onCollisionEnter2D" didn't play even once. (I put the ennemy speed at 0) And made a "on collision speed +1" Any idea ?

2 Comments
2024/04/30
14:14 UTC

7

Just added a fast travel option for my 2D monster hunting game "Beak the Hunter" :)

1 Comment
2024/04/30
10:44 UTC

4

Wanted to add a bit of noise to my grass tilemap. Ended up creating Rainbow road ... (Epilepsy warning !

3 Comments
2024/04/30
08:40 UTC

4

🎉Officially launched the demo for Cyber on the Google Play Store! 🎉

8 Comments
2024/04/29
22:06 UTC

3

I've been making browser arcade games inspired by old favorite like Kirby's Block Ball and Breakout. This one is finally done and I'd appreciate any reviews or feedback! Reflections on what went right and wrong in the comments

5 Comments
2024/04/29
20:34 UTC

1

Pixel grid snap

How to set up pixel grid snap correctly? I want the objects in the editor to move by pixel.

0 Comments
2024/04/29
20:17 UTC

3

.png atlases more efficient than Unity's?

Hi, I had following situation at work, and I'm curious what you guys have to say about it. I animate stuff in Unity, and I had 30 or so 2D sprites of a character that shared common bones, and in general they were all related to one another, after all they belonged to that one hero. So, I didn't want to leave them as they were, I packed them using Unity's Sprite Atlas tool. And yes, the drop in the batches was instantaneous in the play mode, it even dropped by the number of sprites that that hero was using, so clearly that atlas had an impact. But then I got this message:

https://preview.redd.it/ukaooscgsgxc1.png?width=862&format=png&auto=webp&s=156f816b06046fa53f206eebc9c18a210c7a3784

This is from a technical artist in our team. Is he correct about it? He needed me to move all the sprites into one .png, and it would take me hours and hours to do it by hand, luckily I found a tool that allowed me to create such a .png and re-link all dependencies, the only thing I had to do by hand, was to copy/paste all the meshes and bones, but that took me around 15 minutes, so after all it wasn't that bad. But my question is about legitimacy of his request. Does it mean that Unity Sprite Atlas tool is in some ways inferior to the spritesheets we create ourleves? Or maybe he is simply wrong, and hasn't updated his knowledge? What do you think? From what I've seen on the web, Unity's tool shouldn't be inferior in any way, but maybe this case is different?

2 Comments
2024/04/29
18:50 UTC

1

Stardew Valley wind

How can i achieve this wind effect in unity?

https://imgur.com/xwNVCuF

1 Comment
2024/04/29
18:46 UTC

2

I'm new in Unity and i need a help! (BREAK BRICK GAME)

Hello, i'm Design Game student, i'm trying to make a break brick game. My teacher ask us one mechanic and one power up for the game. But i don't have a idea how i can to do two things:

  • I have a sticky brick, this is can stick the ball, I could only release the ball from the brick if I pressed the right button or space button

the power up is a "ball rainbow", it can randomly change to any color compatible with the existing brick in the game scene, when it hits a brick that has the same color as the ball, all bricks in the scene automatically break and the ball returns to normal

OBS: I need to use only nodes! the project need to be free C#

The picture of ball's blueprint and my sprites

If you don't understand what i said, tell me, i'll try to explain the one other way!

https://preview.redd.it/l4x7i87jjgxc1.png?width=2151&format=png&auto=webp&s=6b9cc19a5feeaaa5d82c1302470b55722d88ad71

https://preview.redd.it/nsq5izbijgxc1.png?width=1394&format=png&auto=webp&s=cc801976449ec0e3ace7dc16fe485e368cbeccb6

3 Comments
2024/04/29
18:00 UTC

0

Best resources to start game development in Unity?

Hello! I'm just starting to get into Unity game developing and curious where I should start or if anyone can recommend some useful resources to start? My past experience is only with Roblox Studio which is very easy to navigate in comparison to Unity. Some resources I'd be looking for specifically are videos on how to start programming in C# or whatever I would need to do to program a game correctly, how to work with a character's control, and a general understanding of Unity and the navigation of it or any other recommended resources. Any help is appreciated, thanks!

1 Comment
2024/04/29
15:48 UTC

34

We added a little 2D animation to our game

5 Comments
2024/04/29
15:02 UTC

2

Mesh.uv is out of bounds and Mes.vertices is too small error

3 Comments
2024/04/29
12:39 UTC

1

Unity Volume Slider - Easy Tutorial (2023)

0 Comments
2024/04/29
12:11 UTC

48

After 5 months, my first ever Demo about Cozy Bee Collecting game will be in the Steam Farming Festival today!

5 Comments
2024/04/29
11:13 UTC

0

Carrom Pool

Carrom Pool is like a mix of carrom and billiards, played on a smooth table. You flick your pieces into pockets, trying to clear your side while beating your friends. It's super fun and easy to learn, perfect for kids who love games and challenges! You can play Carrom Pool on Lulubox Pro APK latest version V6.18, which will provde amazing features.

0 Comments
2024/04/29
08:00 UTC

1

Can you use the spline package in 2D?

I tried to use it but it won't let me draw in 2D view. Using tricks like putting it under a rotated parent and edit in a 2d plane in 3d view seem to cause it bug out and get wild co-ordinates that don't match the evctors in the anchors on the inspector.

Is there a toggle im missing? or is just another half assed piece of abandonware from unity?

0 Comments
2024/04/29
07:34 UTC

1

I have a question regarding an Inventory system feature I’m trying to implement in my game.

It’s a top down 2D rpg and I have a simple inventory system in place and an item manger coded. My system functions well enough, character walks over an item the item appears in Inventory, I would like to be able to expand the number of inventory slots in real time by equipping a pack item but cannot for the life of me seem to figure out how to make this feature function in game. The items already have unique slots they fit into so you cannot put items in slots they are not meant to be in, and items have attributes that can implement buffs (one of those buffs being inventory slots). Does anyone have any experience with this type of an inventory system to help give me pointers?

2 Comments
2024/04/29
05:19 UTC

1

Magic is not that useful, Me: Hold my Build.

Was playtesting different party compositions and item builds for my upcoming game Hero's Warband and I have to say magic builds needs some adjusting...

https://store.steampowered.com/app/2896220/Heros_Warband/

https://i.redd.it/0dxhz8ufocxc1.gif

0 Comments
2024/04/29
04:58 UTC

1

enemies and hazard not dealing damage to the player

so i been racking my brain trying to fix the player damage. i gave my enemy hit points in an EnemyHealthManager as well as the player in a HealthManager script its great working fine. I took off the KillPlayer script from my enemy and spikes to add a DamagePlayer script.

now that being said my EnemyHealthManager is working great, but, the DamagePlayer is not causing any damage and i just walk through the spikes and the Enemy just pushes the player.

here is the pastebin: https://pastebin.com/u/johnnygoodguy2000/1/QVcW3K6h

how can i correct this?

I really appeciate the help guys.

https://preview.redd.it/nomfs0usrixc1.png?width=1555&format=png&auto=webp&s=e00809faeae0e25c6a4a52d81c37b3adfb8c17a2

level manager

https://preview.redd.it/0nfa0lh4sixc1.png?width=1914&format=png&auto=webp&s=2c6ad70cb2e5e2270d64deb376179b90eece846f

damage to player was set to 1

spikes damage were set to 2

player tagged and on a player layer

https://preview.redd.it/w7sm9k65ncxc1.png?width=1913&format=png&auto=webp&s=7efdba7090e440fd689ab68cb2a8ce06f80fe214

2 Comments
2024/04/29
04:58 UTC

1

Problem with tutorial "pixel art animation reinvented" form aartificial

https://www.youtube.com/watch?v=HsOKwUwL1bE&t=31s

Essentially, this video demonstrates a technique that simulates a 3D effect. It involves a source animation and a texture, so altering this texture results in corresponding changes to every pixel in the animation. This means that you can modify a character's clothing simply by editing a single texture and all animations will have the change.

The problem that I have is that my source animation does not convert to a uv map. I have not changed a single thing from the files provided in the description of the video.

Thanks in advance.

1 Comment
2024/04/29
04:13 UTC

1

How to turn off Collider2D

Greetings,
I'm not sure if this is the right sub reddit for this, but I'm currently trying to learn unity and I was following a tutorial video that involved making a mock flappy bird game. But I'm currently stuck trying to make sure the score counter doesn't increase after a game over screen. A portion of my code that I was trying to mess with to see if I could get the desired outcome (I didn't).
[This is running on C script]

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEngine.UI;

using UnityEngine.SceneManagement;

public class LogicScript : MonoBehaviour

{

public int playerScore;

public Text scoreText;

public GameObject gameOverScreen;

[ContextMenu("Incrase Score")]

public void addScore(int scoreToAdd)

{

playerScore = playerScore + scoreToAdd;

scoreText.text = playerScore.ToString();

}

public void restartGame()

{

SceneManager.LoadScene(SceneManager.GetActiveScene().name);

}

public void gameOver()

{

gameOverScreen.SetActive(true);

GetComponent<Collider2D>().isTrigger = false;

}

}

6 Comments
2024/04/29
01:23 UTC

2

For some reason, my drop/pick-up script won't work,

I've narrowed it down to hitInfo.collider.gameObject.layer == layerIndex becoming false as soon as the "pick-up" part of the script is fired. For reference the ray cast is inside of the object whilst picked up, so it should detect. I thought it could have something to do with setting it as as the parent's child, however it's still in the same layer, im not sure if it has something to do with raycast relationships with children/parents or not. Any help would be appreciated.

Whilst picked up, ray clearly touching box, however it doesn't register.

https://preview.redd.it/bvp81k4z5bxc1.png?width=506&format=png&auto=webp&s=531b6f557536d7100ca2b3ecb92cd2853c5d403d

3 Comments
2024/04/28
23:53 UTC

2

How to have a ladder as a melee weapon?

Hello! I have just recently finished coding my first visual novel, and while I wait for the art to get finished over the next while, I wanted to practice Unity for the first time! I’m making a 2D metroidvania platformer where the main character mostly moves by means of a ladder she carries with her. I wanted this ladder to be something she carries throughout the game, and even upgrades it over time from a small ladder to an extendable one, an A-frame ladder, etc. it’s a ladder-centric game lmao BUT long story short: how would I go about making a ladder not only an object that can be placed, but then picked back up again/used as a melee-style weapon? Imagine a big flyswatter!

I’ve already learned how to program a stationary ladder, it’s just the “turning it into a weapon/moveable object” that’s giving me some trouble 😵‍💫

7 Comments
2024/04/28
23:21 UTC

17

Grid based level editor

"This tool is designed to be used in grid-based 2D puzzle games. It has a user-friendly interface where users can view, edit, and reset the current state of the level in the editor."

Check this out: https://github.com/berkencami/grid-based-level-editor

2 Comments
2024/04/28
22:55 UTC

0

Looking to build a team for this current project...

Over the past few months, I have been working on this game that is trying to bring aspects of the looter-shooter genre (think Destiny/Warframe) over to the mobile platforms.

I actually used to play these games A LOT, I loved them. But, these games just don't hit like they used to. And I'm really frustrated with where some these studios are taking their games. I really do believe that a mainstream game like this for mobile can really be a memorable experience for mobile gamers around the world. Which is why I decided to set out on this journey in the first place.

Looking to build a team of around 2 to 3 people who are proficient in anything ranging from Programming/Music/SFX/VFX/UI etc. We will continually be developing this game over a certain period of time. Going to try and run a lot of experiments to see what works and what doesn't. But overall, we should develop it alongside the members of relevant gaming communities. I would really appreciate working together on upcoming releases.

Hit me up with a DM if you're interested. Otherwise, A demo will be available to try out tomorrow. So stay tuned → YouTube, Twitter (X), Project Page

5 Comments
2024/04/28
22:05 UTC

1

Swaying Animation Help?

Hello! I was wondering if there's any way to animate an object to sway left and right, so that I don't have to render it out as an image sequence with lots of individual frames. I'll attach an example of the kind of animation I'm looking for. Any help would be appreciated, (and I apologize if this is the wrong spot to ask. I've never used reddit before)

5 Comments
2024/04/28
17:13 UTC

1

Any way to get the number of frames from an AnimationClip @ Start();

I found a work around to just add another clip but I was used to having finer control in other engines. Is there a way to do it? I understand I should do it the Unity way but I feel like I'm close.

  1. You can’t really get an accurate frame count of the animationclip at Start();  It gives the wrong number the first frame, then is correct after. 

frameCount = (int) (animator.GetCurrentAnimatorClipInfo(0)[0].clip.length *  animator.GetCurrentAnimatorClipInfo(0)[0].clip.frameRate);

  1. It could be found in update like this but the first frame would be wrong unless you account for normalized time. 

if (animator.GetCurrentAnimatorStateInfo(0).normalizedTime > 0)        {

frameCount = (int)(animator.GetCurrentAnimatorClipInfo(0)[0].clip.length * animator.GetCurrentAnimatorClipInfo(0)[0].clip.frameRate);

Debug.Log(frameCount);         }

  1. probably best to just add another clip instead of trying to play last.  However, if you count the clip frames yourself you can freeze like this (frame 6 out of 15) but 1f 15/15 defaults to the first frame….so 0f & 15f are the first frame.  The last frame would be 14f/15f…   

animator.Play("CargoDoor Open", 0, 6f/15f );

0 Comments
2024/04/28
16:53 UTC

Back To Top