# Ultimate Character Controller

`RememberUltimateCharacterController` is a Crystal Save component that captures and restores key aspects of an Opsive **Ultimate Character Controller**: equipment, position, view mode, input sensitivity, and attribute values.\
It plugs into the Crystal Save system as a `SaveableComponent` and is usually managed through a **Remember Component** (`RememberComposite`) wrapper.

<figure><img src="https://166712561-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fp47l4hoFKIHGBwL1Cm4D%2Fuploads%2FMq47amEG2zGgk6dKOvfY%2Fimage.png?alt=media&#x26;token=616fb75a-0edd-407a-8fe4-3b33b9bdfa06" alt=""><figcaption></figcaption></figure>

***

### Setup

1. **Add the Remember Component**
   * Select the character GameObject that owns **UltimateCharacterLocomotion**.
   * Add **Remember Component** (`RememberComposite`) via\
     `Add Component → Crystal Save/Remember Components/Remember Component`.
   * In the Remember Component’s list, add **Remember Ultimate Character Controller**.
2. **Behind the scenes**
   * `RememberComposite` keeps a designer-controlled list of hidden `SaveableComponent` instances so their IDs persist across reloads
3. **Result**
   * A hidden `RememberUltimateCharacterController` component is created and registered with the Save system, automatically bound to `UltimateCharacterLocomotion` thanks to `[RequireComponent]` and `[RememberTarget]` attributes.
4. Demo Scene
   * UCC Crystal Save Demo scene requires import of official Ultimate Character Controller Demo Scene. Import it via Package Manager.

***

### Configuration Options

The component exposes five toggles, letting designers choose which aspects of the character to persist:

| Option                         | Saved Data                                                    |
| ------------------------------ | ------------------------------------------------------------- |
| **Remember Equipment**         | Inventory contents, active slots, ammo counts, and clip state |
| **Remember Position**          | Per-scene position and rotation                               |
| **Remember View Mode**         | Whether the camera was in first- or third-person view         |
| **Remember Input Sensitivity** | Look sensitivity, smoothing, and acceleration thresholds      |
| **Remember Attributes**        | Attribute values and min/max limits from `AttributeManager`   |

All selections are serialized into a `CharacterSnapshot` structure for storage and later reconstruction.

***

### Save/Load Flow

{% @mermaid/diagram content="graph TD
UCC\["UltimateCharacter<br/>GameObject"]
RC\["Remember Component<br/>(RememberComposite)"]
RUC\["RememberUltimate<br/>CharacterController"]
Snapshot\["CharacterSnapshot<br/>data"]
SM\["Crystal Save<br/>SaveManager"]

```
UCC --> RC
RC --> RUC
RUC -->|serialize/deserialize| Snapshot
Snapshot --> SM
```

" %}

1. **Serialization** – When a save occurs, the component builds a `CharacterSnapshot` with the enabled data and hands it to the SaveManager.
2. **Deserialization** – On load, the snapshot is restored, reapplying gear, location, camera view, input settings, and attributes.

***

### Summary

* Works with Opsive’s UCC by default and requires `UltimateCharacterLocomotion`.
* Deployed via `RememberComposite` to maintain stable save IDs.
* Individual toggles let you decide exactly which parts of the character state persist between sessions.
