#```cs
1 messages · Page 1 of 1 (latest)
Why are the tile flags not TileFlags.None?
Why is the tile flag LockColor?
Am I supposed to use... https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Tilemaps.Tilemap.RemoveTileFlags.html instead?
Is SetTileFlags only additive?
you assign a different tile after changing the tileflags
does the selectionTile have its tileflags set to none?
Ok so... the flags etc are associated with the tile itself, not the tilemap or a position in the map?
That's quite annoying
but I can work with it
Ok yes - if i reverse those two lines it works.
so if I want that tile in two different colors I need to Instantiate the tile?
yeah the TileFlags are a property on the actual TileBase, it seems that the method on the Tilemap just changes that property (on the c++ side annoyingly so it's not exactly clear in the script bindings)
the docs and scriptbindings aren't exactly clear, but theoretically just calling SetColor should be enough, i don't think you would have to instantiate the tile yourself to change its color.
i'll have to go consult some old projects to see how i handled it though
It seems like if i call SetColor alone it doesn't work because the tile flags are set to Lock Color by default
unless that's a thing I can change... somewhere in the inspector of something?
well i mean after setting the tileflag it should work
it does, yeah
ok that's weird yeah why does that work
That's with this code:
AddShape(new Shape {
Color = new Color32(255, 0, 0, 100),
Positions = new Vector2Int[] {
new(0, 20),
new(1, 20),
new(2, 20),
new(3, 20),
new(4, 20),
new(5, 20),
}
});
AddShape(new Shape {
Color = new Color32(0, 0, 200, 100),
Positions = new Vector2Int[] {
new(0, 22),
new(1, 22),
new(2, 22),
new(3, 22),
new(4, 22),
new(5, 22),
}
});```
AddShape simply runs that previous block of code in a loop for each of those positions
I assumed since they're using the same TIleBase, setting the color would apply to all instances of that tile in the map
I'm definitely missing something about how this works
yeah it's weird. whatever is allowing it to work is happening on the native side though because all of these methods on the tilemap class are extern