ModSquadWorkshop/BossRush — pull request #16 by excaliburHisSheath (2014-09-21 22:46:15+00:00)
Title: Iss#9

Other than adding in the gameplay controls I've also added a player prefab and started scaling down the existing prefabs.

The way I've set up the new player prefab is as follows:

```
Player
|-- Look Target
+-- Transform Root
|-- Player Model
+-- Weapon Anchor
|-- < weapons >
+ ...
```

The player's various scripts go on the root `Player` object, and then the various child `Transform`s are used by the scripts to manage stuff. When the mouse is moved (or the right joystick on the game pad), the `Look Target` object is moved around, and then the `Transform Root` object is set to look at the `Look Target` object. Making the look target a child of `Player` means that it moves around as the player moves around, but it means that the root `Player` object can't be made to directly face the look target (when the player spins to face the look target, the look target spins relative to the player, so they both spin forever). This is fixed by creating another child of the player to act as the root for any models use on the player; Currently I have just a green cube and the weapons as the models for the player.

The way the player prefab is currently setup it can be dragged into a scene and will work immediately, so existing scenes can be easily updated to the new system.