PC Controls
This setup provides a guide on configuring keyboard and mouse input controls for PC gameplay using the Boss AI Toolkit in Unity. It covers enabling PC controls, configuring keybindings, syncing UI joystick animations for PC inputs, and configuring mouse look parameters on the camera.
1. Enabling & Configuring PC Input Settings
Enable the PC control scheme on the player controller and configure keybindings and UI joystick synchronization.
Steps
- Select the main player GameObject (e.g.,
Player New) in the scene hierarchy. - In the Inspector, locate and expand the PC Controls section on the player controller script.
- Check Use PC Controls.
Key Parameter Settings
| Parameter | Recommended Value | Description |
|---|---|---|
| Use Joystick Sync To Child | Checked |
Automatically moves the UI joystick handle visual when pressing PC movement keys (useful for recording gameplay footage). |
| Joystick Handle UI | Drag Joystick Handle | Reference to the UI Joystick Handle transform. |
| Joystick Handle Radius | 120 |
Defines the movement distance limit of the UI joystick handle. |
| Smooth Speed | 30 |
Smoothness speed of joystick transition when keys are pressed. |
2. Setting Up Action & Movement Keybindings
Configure the keyboard and mouse key bindings under Action Key Bindings and Movement Controls:
- Movement Controls:
- Forward:
W - Backward:
S - Left:
A - Right:
D - Sprint Settings:
- Sprint Key:
Left Shift(PressingW+Left Shiftenables forward sprint). - Combat Actions:
- Melee Attack Key:
Mouse Left(Left Click) - Dodge Key:
Space - Shield Key:
X
3. Configuring Camera Mouse Look & Cursor Locking
Configure camera rotation using the mouse and set cursor lock parameters on the camera rig.
Steps
- Select the Camera Rig GameObject in the scene hierarchy.
- In the Inspector, locate the camera controller component.
- Check PC Mouse Look to enable mouse-driven camera orientation.
- Check Lock Cursor On PC to automatically lock and hide the mouse cursor during gameplay.
- (Optional)
- Mouse Rotation Speed X / Y: Tweak mouse sensitivity.
- Mouse Min Y / Max Y: Set vertical tilt limits.
4. Verification Checklist
Before running tests in Play Mode, check the following settings:
- [ ] PC Controls Enabled:
Use PC Controlsis checked on the player controller. - [ ] Keybindings Verified: Key assignments for attack (
Left Click), dodge (Space), shield (X), and sprint (Left Shift) are mapped. - [ ] Camera Settings:
PC Mouse LookandLock Cursor On PCare enabled on theCamera Rig. - [ ] Joystick Sync:
Joystick Handle UItransform assigned if UI synchronization is enabled.