Pagina's

Saturday 9 March 2019

Turning the creepy guy

Sometimes they say AI gets to look creepy if it looks very human-like, but just does not have it to be human. Well, I made a creepy AI today and it does not look human at all. It's a capsule with a cube for arms and a sphere for a head (with a red nose to show direction more easily)


I call him Maze Guy, because he's a guy standing by a maze. What I wanted to achieve was that the guy waits for the player to enter a trigger collider named Passive Range (which starts near the wall with the obsolute door) and from then on, the face will keep pointing to the player object (more specific: the first person camera on the head of the player object, because eyes are up here). When the player gets inside a smaller trigger collider, some interaction like fighting and quest giving will be possible. When the player leaves the area, the maze guy will look to the wall again.

At first, the maze guy was just a capsule with a nose, following the player and turning immediately to face him when he enters the Passive Range. Even though this is just a placeholder for actual graphics later, it did not capture any humanness, so I added a head to move independently. That gave me The Exorcist with a head turning 360 degrees with the body standing still.

This was not actually the kind of creepy I was looking for, so I tried to have the body rotation clamp to the head rotation to have the neck like ours be able to turn a bit, but no more than 30-40 degrees. That worked alright, except when it was switching from 359 to 0 degrees, when the body flashes in big leaps, as in the gif. I fixed that by not changing the angles directly, but by having Unity move them. Now it's up to me to tweak the speed which is just a bit too slow now. 

I also made a little exclamation mark animation, which will indicate that maze guy will have a maze-related quest to perform, the first here. There will probably be something to get inside the maze and to deliver to our creepy friend. It's starting to look like a game.

No comments:

Post a Comment