0
\$\begingroup\$

I have an issue with how the Tilemap works in build, using version 2022.3.

I update my Tilemap with Tilemap.SetTile(Vector3Int pos, null) and it works just fine in Editor.

But in build, it won't update visually. It updates the collider, and player can move through virtually inexistent tiles, while they still being visible. Neither editor nor build throws any errors. Attaching screenshots of Inspector window for Tileset in question and Hierarchy window for Grid. As well as video demonstrating the issue.

Videos:

Editor - https://youtu.be/O5R-vt5KMAo

Build - https://youtu.be/pGal2Bpk7L4

Code snippet:

void Update(){
    if (isUnlocking){
        if (unlockCounter < 0f){
            for (int i = 0; i < sizeX; ++i){
                gates.SetTile(new Vector3Int(startTilePos.x + i, startTilePos.y - rowCounter, startTilePos.z), null);
            }
            rowCounter++;

            unlockCounter = unlockSpeed;
            Vector2 impDir = Random.insideUnitCircle.normalized;
            impulser.m_DefaultVelocity.x = impDir.x * 0.1f;
            impulser.m_DefaultVelocity.y = impDir.y * 0.1f;
            impulser.GenerateImpulse();
            audioplayer.clip = door_open;
            audioplayer.Play();
        }
        unlockCounter -= Time.deltaTime;
        if (rowCounter == sizeY && unlockCounter < 0f){
            Destroy(gameObject);
        }
    }
}

Editor inspector

Grid hierarchy

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

I had the same issue on 2022.3.12. Unfortunately the only fix is to upgrade Unity. Not sure which version exactly, but the latest .31 seems to work.

However, for me upgrading Unity completely broke the scene (cant navigate or do anything but scroll to zoom). Hopefully you dont have the same issue!

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .