Unity Sprite shape corners not showing?

Here is the answer that I was unable to find anywhere else on the internet.

For a while now, I have been scratching my head about getting the corners to work with Sprite shapes, I have been trying a myriad of different options trying to get the Sprite shape corners to work the way I wanted it to work.

What is the problem you may ask? I have been working with getting the edges of my platforms to show corners of my platforms in a consistent way, where I could rely on the outcome of working with the shapes, however, to me it appeared completely random, and something I could not control. Here is an example of the problem

As you can see on this shape, the ends of the spline have these sharp corners.

What I would like to have is this, where the end of the shape goes over the edge, and cover it up nicely.

So, how is this done? Well there is a few things that needs to be in place, and have to be done in a specific way for this to work. First the image itself have to be prepared in the right way, and this is where the “Corner” section on the Spriteshape profile will confuse and send you in a wrong direction. For this to work, you have to create a single image, that have the middle pat and the ends, and the middle part should be able to tile.

It should be set to Full Rect, and have a Pivot in the center. But wait, there is more 🙂 Now you have to go to the sprite editor, and set it up properly in there, like this.

As you see here, the shape have been pulled a bit together, this will ensure that what is displayed at the repeating part of the Spriteshape will be the selected part, where as the ends of the Spriteshape will only show at the edges.

And now comes the part where you add this to the Sprite Profile, again, I am going to repeat, the “Corners” section will confuse you, and you should simply not use it.

Make sure that you set the angles as needed, and select the sprite that you just cut out like you wanted it to. Do not fill in any of the corner sections.. they are set there to confuse the enemy.. and apparently, you are the enemy here.

Now comes the last part, and again, there are some special rules that you should follow here, to get the Sprite shape to work as you want it to.

The key point to shaping your sprite shapes is to know when to use “Broken”, “Continuous” and “Linear” for the points in the Spriteshape. As a general rule of thumb, “Broken” and “Linear” are the only two options that will make your corners appear. If you have ” Continuous” then it will for sure not work. Also, it is important to note, that sometimes, if you have ” Continuous” points on your shape.. sometimes it will work, and sometimes it will not.

My preferred option is to go with Broken, and then add Continuous in the places that is really needed, and then making sure that it will not break it.

On the picture here, you can see that I selected all points, and chose “Broken” to get the effect, I will then put the shape together as I want it to work, and in the places where it is needed, change to the other two options.

You can read the Sprite Shape controller documentation here

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.