Bug with ruled tilemaps only occurs in the build

I have a bug in the build that I don’t have in the editor. As you can see in the video:

https://www.reddit.com/r/Unity2D/comments/xyaqep/i_have_a_bug_in_the_build_that_i_dont_have_in_the/

I change the bookshelf tile and the torch goes off. But the script has nothing to do with it. I use the Unity integrated ruled tilemap. The torch is attached to another ruled tile, but I never change that. does anyone have an idea what I could do to find a solution?

It looks like the tile is reset diagonally to the bookshelf. My script can’t set this kind of tile, it only sets the empty bookshelf tile. I’m pretty sure it has to do with the Ruled Tile script from Unity.

Hi, could you share what your RuleTiles look like in terms of their Rules? Also, could you share how your Torch is set up (eg. GameObject or Tile Animation, what its animation sequence looks like) Thanks!

Hello, I took a screenshot as an example of the rules. The Torch is a GameObject attached to another tile, and with the script it cant go back to unlit. Thats why i mentioned, that the tile with te torch is reset and the old torch got deleted. I use a Rule Tile where each “wall” tile behaves like its neighbor. The code of this “SiblingRuleTile” is attached. Thank you! If you need anything else, let me know.

public class SiblingRuleTile : RuleTile
{

    public enum SiblingGroup
    {
       Wall,
        Floor,
        Hole,
    }
    public SiblingGroup siblingGroup;

    public override bool RuleMatch(int neighbor, TileBase other)
    {
        if (other is RuleOverrideTile)
            other = (other as RuleOverrideTile).m_InstanceTile;

        switch (neighbor)
        {
            case TilingRule.Neighbor.This:
                {
                    return other is SiblingRuleTile
                        && (other as SiblingRuleTile).siblingGroup == this.siblingGroup;
                }
            case TilingRule.Neighbor.NotThis:
                {
                    return !(other is SiblingRuleTile
                        && (other as SiblingRuleTile).siblingGroup == this.siblingGroup);
                }
        }

        return base.RuleMatch(neighbor, other);
    }

The RuleTile set up seems fine to me.

Could you share the Unity version your build is based on? This could be an issue based on the engine itself. Thanks!

Sure, it’s 2021.3.11f1. Thank you.

Thanks! This will likely need an update in the engine itself to resolve this issue.