Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How do I make a slight sharp corner with a Sprite Shape?

Discussion in '2D' started by Pharan, Aug 29, 2022.

  1. Pharan

    Pharan

    Joined:
    Oct 28, 2013
    Posts:
    102
    I'm on Unity 2021.3 and 2D SpriteShape 7.0.6
    I have a Sprite Shape that's a thin platform and want it to step down/angle downwards.

    But whenever I try to do it, it adds unwanted end caps like in the image below.
    I want the sprite to be bent at an angle but still connected, not have two overlapping pieces.

    I want to do this a lot, for other shapes, including closed ones too, so I hope there's a solution that isn't tediously hacky.
    upload_2022-8-29_10-31-29.png

    upload_2022-8-29_10-31-57.png


    upload_2022-8-29_10-41-29.png

    Ferr used to be able to do this but I can't find the option to do the same with Sprite Shapes.
     
  2. DanielTanBK

    DanielTanBK

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    82
    MarekUnity, DavidTeo and Venkify like this.
  3. Pharan

    Pharan

    Joined:
    Oct 28, 2013
    Posts:
    102
    @DanielTanBK
    Oh, that's where the setting is. Thanks so much!
     
  4. GGStudiosLLC

    GGStudiosLLC

    Joined:
    Oct 14, 2015
    Posts:
    4
    Stretched corner mode does not solve all of these issues. It needs the ability to adjust an offset for how far the caps/book ends set in the sprite editor stick out. I run into a lot of overlap issues. Ferr handles this better(It does a lot of things better). Many of their features should be added to sprite shapes, especially since Ferr is now an abandoned asset. I had to abandon Ferr do too texture issues. Once I published to android devices, the edge textures would randomly disappear. At least sprite shapes do not have this issue, but I am struggling to get it to look as good as Ferr was able to accomplish.
     
  5. DanielTanBK

    DanielTanBK

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    82
    Hello, could you elaborate on this or your use case? Or how Ferr solves this issue for you?
    In Unity, the 9-slice borders in the sprite editor allows users to define how much of the edge sprite to be used as cap ends, you can reduce the size of the borders to reduce overlaps
    Unity_gk9VwVm9yy.png
     
    Chubzdoomer likes this.
  6. GGStudiosLLC

    GGStudiosLLC

    Joined:
    Oct 14, 2015
    Posts:
    4
    I have done that, however the problem is that it creates a gap in the tiling. Ferr2D has a cap offset. The only work around I found is a cheap hack. I create multiple slices of the same sprite, one for the left side and one for the right. It's not optimal but it kind of works. It gets a little funky when it tiles beyond a certain length. It's more difficult to get the textures to blend.
     

    Attached Files:

    Last edited: Jun 4, 2023
  7. DanielTanBK

    DanielTanBK

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    82
    Thank you for the feedback, we will take note of this and may consider it in future releases of the SpriteShape package
     
  8. samanabo

    samanabo

    Joined:
    Mar 10, 2015
    Posts:
    51
    I'd like to second this feature request. I think it is also important to consider collision in this use case as well. I believe Ferr provided some configurations around the collision generation for caps. For my purposes having the collider follow the spline would be sufficient, if we have a cap offset.
    Is there somewhere we can track this feature request?
     

    Attached Files:

  9. DanielTanBK

    DanielTanBK

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    82
    Currently no, but any future implementations of 2D features in the editor would be reflected in our roadmap here