Mechs
Create Mech
Set Up Character Controller
Create a new game object and add a Vehicle component
Drag your mech mesh/armature onto the game object as a child
Add a Rigidbody Character Controller component
Add a Gimballed Vehicle Controller to the mech's root transform
Set Up Torso Joint
Create a new game object as a child of the mech and call it 'Torso Gimbal'
Add a Gimbal Controller component to it and drag it into the Gimbal Controller field in the inspector of the Gimballed Vehicle Controller component you added above
Add a new game object as a child of the Torso Gimbal and call it 'Horizontal Pivot'
Add a new game object as a child of the Horizontal Pivot and call it 'Vertical Pivot'
Open the inspector of the Gimbal Controller and set the Horizontal Pivot in the inspector to the Horizontal Pivot object you created, and the Vertical Pivot to the Vertical Pivot object you created
Setting Up The Player
Create a new game object and call it 'Player'
Add a Game Agent component and make sure the Is Player checkbox is checked
Add a new game object as a child and add a MCKPlayerInput_InputSystem_MechControls component to it
Open the inspector of the Game Agent component and drag the mech you created above into the Starting Vehicle field
Now, when you play the scene, you can control the mech, but there are no animations, and the torso will not follow the mouse.
Animating The Mech
Torso Control
To set up the mouse control of the torso:
Open the inspector of the Gimballed Vehicle Controller component on the mech
Add an element to the Followers list
Set the Follower to whatever gameobject or bone controls the torso's rotation, and set the Target to the Vertical Pivot game object you created above.
Now, the torso will follow the joint as it is controlled by the mouse.
Character Animations
Add a Rigidbody Character Animations component to the mech
Automatically, entries should be created for the Parameter Receivers in the inspector, with references to the Animator on your mech mesh/armature
Animator Override Controller
To make it easier to utilise the setup provided in the kit rather than having to build your own animator controller from scratch, use an animator override controller.
Create a new Animator Override Controller in the Project tab by right clicking > Create > Animator Override Controller
In the inspector, set the Controller to the MechController_Titan animator controller provided in the kit
For each of the animations that appear in the list, set the Override to whatever animation you want to use to replace it
Drag the Animator Override Controller you just created into the Controller field on the Animator on your mech mesh/armature
On the Animator, make sure Apply Root Motion is unchecked
Now, when you play the scene, you should have full movement, torso control, and animations.
Independent Legs
To make the legs independently controlled (like MechWarrior) check the Independent Legs checkbox in the inspector of the MCKPlayerInput_InputSystem_MechControls component on the player.
Last updated