Question by
MartinLukasMikus · Aug 10, 2019 at 07:06 AM ·
platformerchunkschunk
How to destroy tilemap via script
Hello, I'm creating simple 2d platformer, and generating the world "infinitely". So I started with chunks everything went well until I found out that I don't know how to destroy them. Every chunk is a Tilemap which is being stored in Dictionary w/ it's Vector2 in world position. If I try to use Destroy(foregroundMap[new Vector2(x,y)]); in unity I'm getting an error : "Can't remove Tilemap because TilemapRenderer depends on it" Any suggestions please ?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612210323im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How Can I make a plane only visible when steped on? 2 Answers
Compiler error 0 Answers
2.5D platformer character turn around (180) 0 Answers
Jumping with convex ground 0 Answers