Hello, I am new to Unity and am trying to create a simple puzzle game. I have an image and I want each puzzle piece to have a part of the image.
Say for example that my image is 100x by 100y. I want piece1 to go from (0x-50x,0y-50y), piece2 from (50x-100x,0y-50y), piece 3 (0x-50x,50y-100y), and piece 4 (50x-100x,50y-100y).
Making a lot of small textures and materials for every piece is impractical. I would like to have one image and through a script assign each piece.
So like… (made up code follows)
piece1 = image1(0-50,0-50)
piece2 = image1(50-100,0-50)
…and so on.
I could then have different images for the puzzle and would only need to change the name in the script.
As I understand sprites don’t render lighting so I’d rather use something else, but if that is the only way then so be it.
So how can I accomplish this?