Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Jigsaw Puzzle Creator Package for Unity

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

Report a bug

A topic by Stone Baked Games created Feb 27, 2022 Views: 336 Replies: 11
Viewing posts 1 to 9
Developer

If you have any problems with the package, please reply to this topic and I will attempt to help you.

(1 edit)

M0,50 C10,49,16 24,83,53,1 18,8,43,1 C12,77,33,1 32,77,33,1 28,8,43,1 C24,83,53,1 40,48,62 50,50 C60,51,38 76,48,56,26 70,33,46,26 C64,17,36,26 84,17,36,26 80,33,46,26 C76,48,56,26 90,51,61 100,50 C110,48,39 127,2,43,3 120,68,53,3 C114,17,63,3 134,17,63,3 130,68,53,3 C127,2,43,3 140,51,87 150,50 C160,48,13 173,32,46,09 168,51,56,09 C163,7,66,09 183,7,66,09 178,51,56,09 C173,32,46,09 190,50,23 200,50 C210,49,77 226,11,43,86 221,18,53,86 C216,25,63,86 236,25,63,86 231,18,53,86 C226,11,43,86 240,50,34 250,50 C260,49,66 273,97,54,36 268,23,44,36 C262,5,34,36 282,5,34,36 278,23,44,36 C273,97,54,36 290,49,51 300,50 C310,50,49 322,17,46,31 318,47,56,31 C314,78,66,31 334,78,66,31 328,47,56,31 C322,17,46,31 340,48,85 

Developer

Ok, I've got a potential fix for you.  If you would be so kind as to download the file at this link: https://www.dropbox.com/s/s8n4ca8h8xt0fu8/JigsawSvgGenerator.cs?dl=0

This is a replacement for the JigsawSvgGenerator script that you can find in "Jigsaw puzzle package -> Jigsaw puzzle generation -> Scripts -> Jigsaw puzzle generation system".  If you replace the script there with this new one and then try again hopefully you should see that the puzzle generates successfully this time.

Let me know if that works and if it does I will issue the fix to the package here so that no-one else has the same problems! 

Developer (2 edits)

Ah ha, I see what the  problem is.  For some reason all the dots (.) in my version have been replaced with commas (,) in yours, so for example I have "49.16" whereas you have "49,16".  The SVG parser uses commas to separate the different values from each other and dots to represent decimal numbers.  So when it encounters the extra commas it thinks it's a new number not a decimal value.

This might be something to do with regional number representations.  I know in some countries decimals are written 12.34 and in others 12,34 so I think that's what's happening here.  I'll have to rewrite some code to force decimal numbers to be written with a dot rather than a comma, but at least I know what the problem is now and should be able to get it fixed for you.

Thanks for posting those values above, that has revealed what the problem is for sure.

Hi! Everything worked! Thank you so much for the skill and the wonderful package!

Developer

That's fantastic, and a big relief!  Thank you for your help with diagnosing the problem.  It was a bug that could potentially affect many other people so I really appreciate you providing the information that was essential for revealing what the source of the problem was.  I'll add the fix to the package shortly.

Some kind of problem with the created prefabs, when we start collecting, they fly apart and remain in such a form that part of the puzzle is already in place!

Developer

Ah, yes, this is because there is not enough space for the pieces to get scattered to.  Try setting the camera size to slightly bigger and then playing the scene again (you may need to rescatter the pieces by clicking the button in the top right).

Good!

I noticed that your game has a wonderful mechanics of creating puzzles from videos or gifs. When an object moves on the puzzle, it looks fascinating. I'm not asking for the source code, maybe you can guide me in which direction to move in order to achieve such a result?

Developer(+1)

Yes, of course.  The trick is to use a render texture for the jigsaw puzzle texture, rather than an image.  You then set up an area out of sight of the main camera where you set up another camera pointing at the animated scene (it could even be 3D).  The output of that second camera gets sent to the render texture, so that whatever happens in the animated scene will show up on the jigsaw.  I hope that helps point you in the right direction.