🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles
(Edited 1 time)

Hi Chris, thank you for your help,
One question, hopefully the last, how does unity recognize that this is the right shape ? and how can i make it less sensitive to the probability that its the right one.
because right now i have to move it by the mil to get the star fade
Also how do i create a line renderers for different polygon colliders (tangrams) I see the prefab positioning but I dont know how to create a custom one.

I used Unity's physics engine for collision detection. Each of the tans/pieces has a polygon collider attached to it. When all of the vertices for the colliders of the pieces are inside the collider for the puzzle, I know that the pieces are all inside the puzzle, and the puzzle has been solved.

The pieces were drawn in a program for MacOS called AffinityDesigner. I use it to make vector graphics for most of my games.

The puzzle is drawn by the PolygonRenderer class. If you attach a PolygonRenderer to a gameobject that also has a PolygonCollider, the renderer will find the collider, and loop through the vertices on the collider to draw the shape. It uses the scripting interface for the Unity LineRenderer component to create the lines.