Characters can turn!

Fixed some bugs in the character’s attention system today. Feels silly to fix bugs in a system due for replacement in it’s entirety in the next version, or certainly the one after that, but if V0.1 is to be finished then the scaffold needs to work I guess.

Characters can now turn to face things.

There’s three animations, one for turning left 90 degrees, one for turning right 90 degrees, and one for turning the full 180.

But of course most of the time the amount of turning required won’t actually be any of those, it’ll be 43 degrees or 22 degrees or 145 degrees or whatever.

Simple enough, I thought, just rotate the character an extra amount as it turns to make up the difference.

Only it turns out that the characters don’t actually turn 90 degrees when you cross-fade into an animation of them turning 90 degrees, because for the first 0.1 of a second or so they’re only *partly* playing the animation, they’re also playing whatever they were originally doing merged with the turn animation. So they actually turn less than 90.

Figuring that out took a couple of hours.

Ended up with a system that doesn’t even bother to try and work out the exact amount it should turn differently to the animation, but instead just rotates them by an amount proportional to the time until the animation finishes until it does, by which time it’s close enough to just snap into position.

Looking okay though, at least as okay as it needs to for a system due to be replaced entirely in a few months.

Se doesn’t really respond to hand-waves the way I made it appear in this little gif, I just timed the hand-wave fairly well compared to her scripted turn-after-ten-seconds.

Leave a Reply