Colliders not removable after build
I use a 2D tile map composite collider to make colliders for platforms an i have a function that makes holes in the ground by remoivng tiles. Seting the tile to null usually removes the collider.
private void OnCollisionEnter2D(Collision2D collision) {
if (collision.gameObject.CompareTag("myObject")) {
Vector3 hitPosition = Vector3.zero;
foreach(ContactPoint2D hit in collision.contacts) {
hitPosition.x = hit.point.x - 0.1f * hit.normal.x;
hitPosition.y = hit.point.y - 0.1f * hit.normal.y;
PlayRandomDigSound();
destructableTilemap.SetTile(destructableTilemap.WorldToCell(hitPosition), null);
}
}
}
This scipt works fine in the editor and I've never notised anyting wrong until i make a windows build out of the game. Now the tile is removed on collision but the collider remains. My generation type is set synchronous on the composite collider.
Is there any build setting that causes this kind off problem? I think I've tried unchecking everything to do with meshes and colliders.
I'm very appreciative of any help! Thanks!
Your answer
Follow this Question
Related Questions
How to make a collider get the position from every tile it touches? 1 Answer
[HELP] Player passes through red tiles even though it shouldn't 1 Answer
Tilemap Collider not Colliding 0 Answers
Player get's stuck on Tilemap Collider 2D 0 Answers
Ignore collisions with water if ground above water 0 Answers