#Can i dm you
1 messages · Page 1 of 1 (latest)
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
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
If you hit this arrow to expand the keyed properties, what's in there?
Right, so the keyframes are changing the explicit sprite reference
Which means the system I originally explained will be necessary for sprite swaps
How would it be?
I mean this #🖼️┃2d-tools message
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
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?
You would have a script component which gets reference to sprite renderer component and overrides the sprite reference according to an array of sprites
The script would have a variable for sprite index to choose which sprite to assign from that array, and the animator would animate that variable*
It also needs to be able to run in editor so you can see the sprite changing when you make the animations
That sounds so difficult
It likely is
And do note I haven't done this actually, it's all theoretical
Could be unexpected pitfalls
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
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.
@peak basalt 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]