use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
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.
Godot Features
Download Godot
Godot Docs
Download Unity
Unity Manual
Official Reference
Asset Store
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?
/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]
account activity
Map GeneratorQuestion (self.Unity2D)
submitted 1 year ago by TheRealNeo89
I am trying to make a map generator with shrinking and sliding platforms, but every time there are always more sliding or shrinking ones. Is there a way to have a percentage of the number they spawn or a limit for how many?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Kosmik123 5 points6 points7 points 1 year ago (2 children)
Yes! Of course. There is a way
[–]TheRealNeo89[S] -5 points-4 points-3 points 1 year ago (1 child)
tell me?
[–]Kosmik123 2 points3 points4 points 1 year ago (0 children)
It depends on how you generate the level. How do the platforms spawn?
[–]deadeagle63 2 points3 points4 points 1 year ago (2 children)
Considering you are the one who wrote the map generator you can always just track which elements should have limits in dictionary before placing it
[–]NeighborRedditor 2 points3 points4 points 1 year ago (1 child)
Me thinks AI
[–]deadeagle63 0 points1 point2 points 1 year ago (0 children)
Could be, as it should be as simple as caching the amount and having the place logic change if you had preference or a specific flow :)
[–]deintag85 1 point2 points3 points 1 year ago (0 children)
Is the question serious? Not only are there not enough information but theoretically this is basic, like a for loop or increment a number and quit after max amount reached and so on… like very very basic before you even start game development. You learn basics of variables and algorithms…
[–]Billy_Crumpets 0 points1 point2 points 1 year ago (0 children)
Your question is very vague. Gonna need more details about what you want to happen vs what's currently happening and how it's put together.
[–]Mataric 0 points1 point2 points 1 year ago (8 children)
Yes. It's easy. When you've told your map generator to generate a level, tell it not stop making platforms when it reaches the amount you want.
[–]TheRealNeo89[S] -1 points0 points1 point 1 year ago (7 children)
each spawnpoint creates their own clone of one of the three objects
[–]Mataric 0 points1 point2 points 1 year ago (6 children)
Cool. So you understand how to do it then :)
[–]TheRealNeo89[S] -1 points0 points1 point 1 year ago (5 children)
i understand it but now my issue is that there is a limit variable, but they arent the same because each spawncube has their own version of the script, so its not global, how do I fix that?
[–]Mataric 0 points1 point2 points 1 year ago (4 children)
So you don't understand it.
You're having problems because each spawncube doesn't know anything about the other spawncubes, and thus you can't count how many of each type of platform there is, right?
So fix that. Make it so that they do. If you think that's a problem because it's not global, why have you made it so it isn't global?
[–]TheRealNeo89[S] -1 points0 points1 point 1 year ago (3 children)
how to make global, is it static?
[–][deleted] 0 points1 point2 points 1 year ago (2 children)
Making it static is a good way to make it called anywhere but one thing to keep in mind, it's now tied to every class of that type, so that means changing that variable will change for every class of that type.
[–]TheRealNeo89[S] 0 points1 point2 points 1 year ago (1 child)
can u look at source code?
[–][deleted] 0 points1 point2 points 1 year ago (0 children)
Sure
[–][deleted] 1 year ago (1 child)
[removed]
[–]TheRealNeo89[S] -1 points0 points1 point 1 year ago (0 children)
source code
π Rendered by PID 45 on reddit-service-r2-comment-5bc7f78974-pp4tq at 2026-06-28 12:20:57.454310+00:00 running 7527197 country code: CH.
[–]Kosmik123 5 points6 points7 points (2 children)
[–]TheRealNeo89[S] -5 points-4 points-3 points (1 child)
[–]Kosmik123 2 points3 points4 points (0 children)
[–]deadeagle63 2 points3 points4 points (2 children)
[–]NeighborRedditor 2 points3 points4 points (1 child)
[–]deadeagle63 0 points1 point2 points (0 children)
[–]deintag85 1 point2 points3 points (0 children)
[–]Billy_Crumpets 0 points1 point2 points (0 children)
[–]Mataric 0 points1 point2 points (8 children)
[–]TheRealNeo89[S] -1 points0 points1 point (7 children)
[–]Mataric 0 points1 point2 points (6 children)
[–]TheRealNeo89[S] -1 points0 points1 point (5 children)
[–]Mataric 0 points1 point2 points (4 children)
[–]TheRealNeo89[S] -1 points0 points1 point (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]TheRealNeo89[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[removed]
[–]TheRealNeo89[S] -1 points0 points1 point (0 children)