#Can i dm you

1 messages · Page 1 of 1 (latest)

peak basalt
#

No, but we can have a thread

#

What I mostly just want to know is if your animations have keyframes for sprite references
But if you want to give the full picture you could show screenshots or a video of what your typical animation and swappable sprite look like

wanton swallow
#

I have an animator for my player with some animation clips. In my player script i have a variable that changes depending on the player situation and the animator switches between clips depending on the variable value.

#

My animations are like that

#

And what im trying to achieve is to be able to change my player skin before starting playing but mantain the same animations and animator, just play them with another set of sprites to reskin my player

peak basalt
wanton swallow
peak basalt
# wanton swallow

Right, so the keyframes are changing the explicit sprite reference

#

Which means the system I originally explained will be necessary for sprite swaps

wanton swallow
#

How would it be?

peak basalt
#

Sure, it's more complicated than anything I've had to do for sprite animation so far
But it's also practically the only way

#

The other ways are to create a new version of the animation for every possible character appearance or to recreate sprite renderer's functionality with custom shaders to create a animatable variable for "sprite index on sheet"

#

Or possibly some more ways I haven't thought of

wanton swallow
#

So i would have to point sprite renderer to my new asset wich would be a set of sprites instead of a single sprite?

#

And somehow tell my animation which sprite of the asset to use for that animation?

peak basalt
#

It also needs to be able to run in editor so you can see the sprite changing when you make the animations

wanton swallow
#

That sounds so difficult

peak basalt
#

It likely is

#

And do note I haven't done this actually, it's all theoretical

#

Could be unexpected pitfalls

wanton swallow
#

Yeah

#

But i will try to do something similar

#

Thanks for your idea

peak basalt
#

Good luck
This would be trivial for Unity to implement, if only they associated sprite index and sprite sheet ID along with individual sprites and let us change that on sprite renderer

wanton swallow
#

Hi, i made a script component which contains my skin asset. The skin asset contains an array of sprites for every animation, but i dont know how to set those sprites from animations.

wanton swallow
#

@peak basalt do you know how to?

peak basalt
# wanton swallow <@166982635950702592> do you know how to?

My idea is that the script has an "index" variable accessible to the animator, which corresponds to a sprite on the array
The script would have a reference to the sprite renderer and override the sprite reference with one from the SpriteArray[index]