Day 38 – Pivot! Pivot!! Pivot!!!

Remember how two days ago I said that I wanted to work on something else than animations? Well guess what… working on animations is exactly what I have been doing.

While implementing the gun holding I made some modifications to the walking/running and I noticed there were some problems with it. Characters sometimes didn’t stop exactly where they were supposed to and when turning they moved outside of the tiles they were allowed to step into.

Long story short, it needed looking into.

Until now I had been using prebuilt motions (walking, running, drawing your weapon) that came with the character controller asset I use. The problem with most of the character controllers you find on the asset store is that they are mostly designed for active player input, usually found with a a third or first person game.

But in my case characters are never controlled directly by the player, the player just issues a command of where the character should move to.

With an input controlled first person shooter, it usually doesn’t matter that much if you stop half a meter earlier or later or that you step outside the boundaries of your tile, you can make corrections yourselves by adjusting the input. But in my case that’s not what I want, I want very exact control over the movement so I need to find implementations that fit.

Because a lot of the asset is still a black box, I decided to create my own implementation of a motion, and plug it in. There’s a lot to figure out and it’s slow going, but I already have a better understanding and gives me more control. Besides, there’s still several implementations that came with the asset that I can either use directly or at least use as example code.

What I have been working on for the past two days is the pivot motion. Before starting to walk or run, the characters should first turn towards the direction where they want to go, and then start walking. The same movement will be used when turning to face an enemy, for example when executing the capture action.

I got some kinks to iron out still but making progress, as you can see in the video.

PS: In case you missed the reference, you can find the Friends scene that the title refers to on Youtube.

Gamedev Diary Knock-On Effect

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: