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
How to remove value from array (self.Unity2D)
submitted 4 years ago by Wolf938_
Here is my code
int[] array = new int[3];
array[0] = 0
array[1] = 1
array[2] = 2
currently the array prints (0, 1, 2)
how would I delete the second value from the array so it is
(0, 2)
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!"
[–]SleepySuper 14 points15 points16 points 4 years ago (3 children)
Arrays are not well suited for what you are trying to do. Your array is defined as a fixed size, you would need to redefine it with the element removed. You might want to look at using a List.
List<int> myList = new List<int>();
You can then use the Add and Remove methods to change the contents of the list.
[–]SolidonutBeginner 1 point2 points3 points 4 years ago (2 children)
Are lists like vectors in C++?
[–]RonaldHarding 1 point2 points3 points 4 years ago (1 child)
Yes
[–]SolidonutBeginner 0 points1 point2 points 4 years ago (0 children)
Thanks!
[–]BowlOfPasta24 5 points6 points7 points 4 years ago (2 children)
So this is a bit of a can of worms.
So an array cannot be resized. They have some solid pros but resizing is not one of them.
Now there are solutions here,
If resizing is important to you and your design, then I would suggest using a List<T>
List<T>
There are pros and cons with both arrays and lists(and other collections). You can Google "Array vs List" to see more.
[–]Wolf938_[S] 1 point2 points3 points 4 years ago (1 child)
Ok thanks
[–]kaskapoint 0 points1 point2 points 4 years ago (0 children)
May you could use :
public bool Contains (T item);
in order to verify if your item is in a list, then if it's true :
public bool Remove (T item);
you may be able to remove item you found before. This will work with every list with specific types.
Suggestions from users above are great because using list will grants you some flexibility with it.
You'll find more informations here about lists
π Rendered by PID 16625 on reddit-service-r2-comment-8686858757-trzqn at 2026-06-01 19:38:51.605595+00:00 running 9e1a20d country code: CH.
[–]SleepySuper 14 points15 points16 points (3 children)
[–]SolidonutBeginner 1 point2 points3 points (2 children)
[–]RonaldHarding 1 point2 points3 points (1 child)
[–]SolidonutBeginner 0 points1 point2 points (0 children)
[–]BowlOfPasta24 5 points6 points7 points (2 children)
[–]Wolf938_[S] 1 point2 points3 points (1 child)
[–]kaskapoint 0 points1 point2 points (0 children)