Unity-Technologies / 2d-extras

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

Prefab brush bug. #120

Open RocketPrinter opened 4 years ago

RocketPrinter commented 4 years ago

When calculating where to place the prefabs it doesn't take the tilemap position in consideration.

For example: you have a tilemap with the position set to x=50, y=0. You place a prefab at tile (100,0) but because it doesn't take the tilemap position in consideration, the prefab will appear at tile (50,0) not (100,0).

I have a link to a custom version of the script with the problem kinda fixed and some tweaks I made to be able to rotate the prefabs. https://paste.myst.rs/gfv

ChuanXin-Unity commented 4 years ago

The prefab brush does not take into consideration the position of the BrushTarget. Rather, it uses the position of the Grid but parents the instantiated Prefab to the BrushTarget.

I guess this can make it strange to use with your use case. Possibly a toggle can be added to determine which transform should take priority.