Hello,
I have been experimenting a bit with animating characters in Unity and found out that for what I want to do I’ll need a little more control than the docs seem to offer. Basically, I want to create a 2D-feely game where all the 3D models are animated as if they were 2D sprites. That basically means no blending or cross-fading and a limited number of character frames rendered. Don’t know whether this’ll look any good or not but figured I’d try and see.
Problem is though, I don’t know how to turn off animation blending or even if it’s possible in Unity. I could split every frame into a separate clip and control it that way I guess but that would be a rather ugly solution. More importantly, I’d also like to control the speed of individual frames within a clip, say have the clip’s frame 3 to 4 play at 0.75 speed while 4 to 7 plays at 0.6 for instance.
Anyone able to help out?
It sounds like what you’re looking for is the ability to play only the ‘frames’ of animation from your 3d app at a fixed framerate, and not have any kind of interpolation between each frame. Most 3D game engines (unity included) are simply interpreting animation curves in a time-based manner - they have no concept of your animation in terms of frames or poses, and there’s no built-in setting to achieve that effect at the moment.
I see two approaches for having 3d characters animate at a fixed, choppy framerate. One is as you described - write yourself some code that plays a series of animation clips that are single poses. Another option (if your game is seen from a fixed 2d perspective) would be to create a series of ‘sprites’ by rendering your character out from your 3d app, apply them as a texture to a plane facing the camera and cycle through them in a similar way. Either of these approaches would be a major content-creation bottleneck though.
Unity could incorporate a “fixed framerate” option when playing back an imported animation, but I wouldn’t hold my breath as the number of applications are minimal. Basically all it would need to do when evaluating your character’s pose is look at the curves, and always ‘round down’ its assessment to the last whole frame (divide the current time by your framerate and chop off the decimal). Come to think of it, you MIGHT be able to do this yourself if you have two synchronized versions of the same animation playing together - one who’s playing normally, and one that you’re manually setting its ‘time’ value based on the time of the other, divided by your framerate and rounded down. Not sure if that would work though.
I thought about rendering each frame out, then slap them onto a large surface and animate them by moving UV’s around but I’m afraid it might suck up too much video memory (many many frames :p). So right now I split every frame into a separate clip on import. Works, but it’s tedious to set up all those frame names and ranges in the import dialogue. I also tried to add clips through code but that didn’t work at all. Hope it’s just me doing something wrong… will try more later when I get home.
Anyhow, thanks for the heads-up
Have you ever played Super Smash Bros. Melee? There’s a character called Mr. Game and Watch. He’s animated the same way that you want. The way he’s built is that he isn’t a 3d character, but rather a 2d image that changes textures based on his current state (idle, walk, run, etc). He only has 2-5 frames of textures per state.
But, he is a 2d character, and you say you want to do the same with a 3d character? All you have to do is go into your 3d graphics program, and make his animation instant between keyframes (don’t base it on frames, just the keyframed animation).
It’s hard to explain. I can show you a demonstration of what I mean later.