2 years ago

#20691

test-img

Viktor

RemoveAll(Predicate<T> match) not removing items

Im making a game where we made a tilemap, the tilemap is a list with tile objects. Tile objects have a position. We want to be able to remove these tiles and asking around i go told to use

tiles.RemoveAll(item => item.position == new Vector2(MathF.Round(playerPosition.X), MathF.Round(playerPosition.Y)))

How ever, this does not remove any of the tile objects even if the vectors match.

c#

monogame

0 Answers

Your Answer

Accepted video resources