Unity-Technologies / 2d-extras

Fun 2D Stuff that we'd like to share!
Other
1.54k stars 342 forks source link

Locked Transform on Hexagonal Rule Tiles #250

Open Eyonex opened 3 years ago

Eyonex commented 3 years ago

Hello, I do not know if it is supposed to be like this but the tile transform flag is locked on rule tiles.

1

I am trying to do a small animation where the tile slightly changes its offset with the Tilemap.SetTransformMatrix when clicked. Normal tiles work fine but the hexagonal rule tile I am using to create the rocky edges can't be moved since the transform flag is locked and I can't seem to find any way to unlock it.

2

Do you know if I'm doing something wrong or is there a way to unlock the transform?

ChuanXin-Unity commented 3 years ago

Hi, for this, you may want to use Tilemap.Add/RemoveTileFlags API with the TileFlag.LockTransform. This will allow you to adjust the transform matrix for the Tile at a position.

Hope this helps!

On Fri, 27 Nov 2020, 04:50 Eyonex, notifications@github.com wrote:

Hello, I do not know if it is supposed to be like this but the tile transform flag is locked on rule tiles. [image: 1] https://user-images.githubusercontent.com/14252343/100390390-7be37600-3030-11eb-9efe-648aa643dd44.PNG

I am trying to do a small animation where the tile slightly changes its offset with the Tilemap.SetTransformMatrix when clicked. Normal tiles work fine but the hexagonal rule tile I am using to create the rocky edges can't be moved since the transform flag is locked and I can't seem to find any way to unlock it. [image: 2] https://user-images.githubusercontent.com/14252343/100390565-28255c80-3031-11eb-92b5-f6bdce8f16af.PNG

Do you know if I'm doing something wrong or is there a way to unlock the transform?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Unity-Technologies/2d-extras/issues/250, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA3TETPCZYLRRMOL6PTJTDSR25Q3ANCNFSM4UEEW3GQ .

Eyonex commented 3 years ago

Hi, for this, you may want to use Tilemap.Add/RemoveTileFlags API with the TileFlag.LockTransform. This will allow you to adjust the transform matrix for the Tile at a position. Hope this helps!

Yes, thank you so much!!!