Search Unity

Sliced Sprites possible bug

Discussion in 'General Graphics' started by srylain, May 11, 2017.

  1. srylain

    srylain

    Joined:
    Sep 5, 2013
    Posts:
    159
    http://i.imgur.com/78wBXjU.png

    As you can see in the image above, I'm trying to pretty closely emulate Guitar Hero. My problem is with the sustains (the tails that some of the notes have). In order to keep the rounded end, I'm using sliced sprites so it stretches everything but the end when I scale them.

    The bug I'm seeing, is that sometimes the sprite will be stretched in the wrong way (the yellow sustain that is closest to the camera should be the exact same width and length as the red one right next to it) which only lasts for a frame or two and then it will render normally (sometimes it'll flicker around and get even more distorted).

    I see sliced sprites referred to as 9-slice sprites, and currently my sprites aren't sliced in 9 ways (this is how they're currently sliced: http://i.imgur.com/a1t1Tax.png) and I'm thinking this might be the problem. If it isn't, could anyone give some insight to why this is happening?

    Also, I think it may be causing a crash (a full quit to desktop crash). Using the crash log I traced it back to where I set the sprite for the sustains I believe (I set the sprites for the notes in another script), and it seemingly happens at complete random. Sometimes I can play a couple songs with no crash, and sometimes it'll just crash when playing the first song. It does crash inside the Editor too (full quit to desktop crash as well). Does anyone know if the sprites not being sliced correctly causes this?