Tuesday, 26 February 2013

Character Controller without Character Controller Component




I've been given a task to build a prototype of a Character Controller. At the beginning it all seem to be easy enough task to do. After a short research on UnityWiki i found a ClickToMove script, which is actually perfect for this game, but it has some drawbacks as well.
Game Object is ignoring walls and going right through them or falling through the plane, applying rigid body to Player object does not make any difference.
While facing these difficulties i've came up with perhaps not quite perfect, but workable solution. We have own ClickTo Move script, which is working for the purpose intend to. 
While working on the Character Controller I've asked myself, 'do we really need to change the actual look of the cursor ?' I thing 'yes', therefore as an addition we have a script, where the cursor is changing it's 2DTexture for both, attack and move. Setting up more textures such as search or use item is optional.
The last part is adding a shadow, this has been achieved by using a projector and moving player to a different layer.
Next goal will be tweaking Character Controller script and APathFinding system as well.

1 comment: