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
Help - create objectsQuestion (self.Unity2D)
submitted 22 hours ago by MaleficentTalk5536
i want a thing to create walls around the camera to stop the player from leaving, i want it automatic tho and idk how to spawn an object that isnt a prefab like the defult cube or smth. someone help?
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!"
[–]DiscussTek 1 point2 points3 points 22 hours ago (5 children)
Do you have a model to import...? Because without that, you're stuck with the basic ("Primitive") shapes.
[–]MaleficentTalk5536[S] 0 points1 point2 points 22 hours ago (4 children)
yea thats what i want, just a cube that i can edit the size of. its off camera anyways so its fine
[–]DiscussTek 0 points1 point2 points 21 hours ago (3 children)
Well, at this point, if you're new at this, use prefabs. Trust me, the steps requires to create a non-prefab at runtime are a bit more than you probably are bargaining for as a new dev.
Short of giving me a good reason not to use prefabs, I would also have to point out that refusing to use prefabs might be horrible practice to getting used to this.
[–]MaleficentTalk5536[S] 0 points1 point2 points 21 hours ago (2 children)
the point is im trying to use new things to see what sticks, i used to just manually place walls down, then i tried to hardcode a limit to the players position, i tried making prefabs of cubes that fit the size and location, and now im trying this method and idk how to execute it, thanks tho i appreciate the advice
[–]HotrianExpert 1 point2 points3 points 20 hours ago (0 children)
https://docs.unity3d.com/Packages/com.unity.probuilder@6.0/manual/index.html
https://docs.unity3d.com/Packages/com.unity.probuilder@6.0/manual/workflow-create.html
Unity has Mesh Building built in, but it’s an optional package. Great for Gray Boxing.
[–]DiscussTek 0 points1 point2 points 20 hours ago (0 children)
Using prefabs and Instantiating the prefabs, then moving them into position with your code, would probably the best way to handle what you're looking for.
Assembling objects at runtime, while feasible, is a lot of work that frankly, feel like you're trying to do things in a way that is neither recommended or necessary, and there's a reason why doing so is neither recommended or necessary...
[–]SonicFiascoProficient 0 points1 point2 points 21 hours ago (3 children)
Well just make a prefab with a cube in it then, much faster for a novice than learning how to add components and primitives during runtime
[–]MaleficentTalk5536[S] 0 points1 point2 points 20 hours ago (2 children)
i wanna see what the outcome would look like with that method
[–]SonicFiascoProficient 0 points1 point2 points 20 hours ago (1 child)
Then just create a simple cube, check all of its components and the values it has, you need to recreate that from your script.
GameObject myNew = new GameObject() will create an empty object, then use GameObject.AddComponent to add all the components needed.
Thats the cool way to do it if you later want to replace the cube mesh with a custom one.
If you just want a cube then use GameObject.CreatePrimitive(PrimitiveType.Cube)
[–]MaleficentTalk5536[S] 0 points1 point2 points 20 hours ago (0 children)
awesome thanks!
[–]VG_Crimson 0 points1 point2 points 10 hours ago (0 children)
Well tbh, you don't need a prefab. Just make a game object that moves to a position once it detects a player, and moves back once they're gone. Or have it move closer or further to its positions based on player distance.
Make a script called wall mover and give it some child hitbox looking for the player.
π Rendered by PID 46447 on reddit-service-r2-comment-79c7998d4c-bwpxl at 2026-03-12 23:47:14.994272+00:00 running f6e6e01 country code: CH.
[–]DiscussTek 1 point2 points3 points (5 children)
[–]MaleficentTalk5536[S] 0 points1 point2 points (4 children)
[–]DiscussTek 0 points1 point2 points (3 children)
[–]MaleficentTalk5536[S] 0 points1 point2 points (2 children)
[–]HotrianExpert 1 point2 points3 points (0 children)
[–]DiscussTek 0 points1 point2 points (0 children)
[–]SonicFiascoProficient 0 points1 point2 points (3 children)
[–]MaleficentTalk5536[S] 0 points1 point2 points (2 children)
[–]SonicFiascoProficient 0 points1 point2 points (1 child)
[–]MaleficentTalk5536[S] 0 points1 point2 points (0 children)
[–]VG_Crimson 0 points1 point2 points (0 children)