#How do I fix the UV of my sprite flipbook shader?

1 messages · Page 1 of 1 (latest)

bronze sonnet
#
#

Partially fixed: Set sprite type to "Single" instead of "Multiple"

#

Sprite is stretched out, though

#

I can fix it technically by forcing the width to 16 by using "sliced"

#

Ok well, I'm not really sure why but when I changed it back to "Simple" draw mode, the aspect ratio was corrected

#

Whatever

blazing stump
#

You could instead use a quad mesh (with sorting group component if you want sprite sorting), or a sprite graph with a dummy sprite

bronze sonnet
#

Without an animator

#

I don't want to make an animation for every power up item I have

#

the way I have it right now works because I just set the X scale to 0.5

#

and that fixed the stretching

blazing stump
#

Both my suggestions are for using the flipbook shader as you do now, but to make it work better with sprites

bronze sonnet
blazing stump
#

But alternatively scripts can also be used to swap the sprite of a sprite renderer

bronze sonnet
#

Yeah I wanted to avoid that

#

I'd rather just have one spritesheet as an input and just have it automatically animate

blazing stump
bronze sonnet
#

Ohhhhhhhh

#

That makes a lot of sense

#

That would explain why changing the scale to 0.5 worked, since there are only two sprites and they're arranged in a row

blazing stump
#

But it can't be the sprite sheet itself, because the sheet is much bigger in single mode than one sprite on it
And in multiple mode the sprite renderer is taking only the UV region of one individual sprite so the UV modifications from the flipbook node are no longer valid

bronze sonnet
#

Yeahh

#

that's pretty easy then, I'll just make a blank 16x16 sprite

blazing stump
#

Yes, that'll be valid for any 16x16 sprite sheets you have