Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Jigsaw Puzzle Creator Package for Unity

Create fully functional jigsaw puzzle prefabs to be used in Unity projects · By Stone Baked Games

I'm going to customize the shape of the piece

A topic by username_zmf created Jul 13, 2022 Views: 132 Replies: 1
Viewing posts 1 to 2

Bro, your code is great, I bought them, but if I'm going to customize the shape of the piece, what should I do

Developer

That's a great question and I'm afraid it's a bit complicated so bear with me.

Option 1) if you're comfortable with SVG paths then you can create your own version of the JigsawSvgGenerator (called from the JigsawPuzzleGenerator at line 612).  This is what currently creates the SVG path for the whole puzzle before that gets converted into vertices and UVs by the VertexGenerator (at line 629).  

Option 2) get rid of the SVG generator entirely and instead replace the VertexGenerator with your own system to create the pattern you want (both vertices and UVs for each piece are currently created by the GeneratePuzzleVertices() method in the VertexGenerator).

You should be able to leave everything else more or less as-is as long as the vertices and UVs you create are sensible.

For both of these options you will need to make sure the puzzle pieces stay roughly square (+/- 20% or so) as the puzzle manager relies on a grid-like pattern to work properly, but otherwise I think you can create any sort of shape along the sides of the pieces.

I hope that helps get you started.  If you have any questions feel free to DM me on Twitter (https://twitter.com/StoneBakedGames) or e-mail directly (tim at stonebakedgames.co.uk).  

Good luck!