- Home /
Detaching a GameObject from a Tile at runtime
I have a Tile that - during runtime - needs to sometimes change itself into another tile. To handle that it comes with a GameObject and script that handles that logic and keeps track of the changes. I normally would have put the logic onto a custom tile, but the animation changes I need are too complex for GetTileAnimationData.
Only problem of course is that when the tile changes, it destroys the associated GameObject and substitutes it for whichever one the new tile has (or none, if the new tile doesn't come with one). I need the original GameObject to remain behind when the tile changes.
So I figure the best way to do that is have the GameObject detach from that tile and tilemap on Start, but I don't see anyway to do that on the tilemap. I tried unparenting it from the tilemap but that doesn't help, the connection between the tile and gameobject is somewhere.
Any advice? Or work arounds?
Your answer
Follow this Question
Related Questions
Remove a single tile from a tilemap 1 Answer
TileMap won't show up in 2d object in heirarchy. 0 Answers
SetColor() In Tilemaps Isn't Working. 0 Answers
2D tilemaps - separation of view and data, prototyping doubts 0 Answers
Changing Size of Tilemap 1 Answer