We focussed on the enemy asset this week. As with last week, we were provided with the enemy asset (a menacing spider) and animation states that we were to prioritise. In addition to setting animations, we were shown how to implement a basic Enemy AI system with a state manager.
Bases/points of interest were placed on the map and behaviour was set up so that the spider patrolled through all these points in some sort of a continuous method. The spider was given an area of sight that if the player were to enter, the enemy was to exit the state of patrolling and enter the alert state, start to run towards the player and attack it.
This time, we were shown the Animation blend component that attempts to blend different animations together to give a smooth animation that made sense.
There was an issue where the spider would fall through the ground if the player attacked it and sometimes the spider would also flip its-self onto it’s back when the player attacked. I had a suspicion this happened because of a collision detection / collider issue on the spider, so I changed the spider’s collider to a convex mesh collider and this seemed to fix the issue.
A side note, just in-case you are curious as to why the mesh collider had to be convex: Unity 5 uses Nvidia’s PhysX 3.3 (up from 2.8.3 in Unity 4.x.x). There is a PhysX restriction that triggers must have a convex shape. Since I wanted the player’s sword to enter the spider, the spider needed to be a trigger, so it didn’t push the player, or it’s self when colliding with the sword.
This is Daniel Jochem, signing out.