# Setup

This integration lets a Game Creator 2 Character use Malbers Animal Controller as its movement, rotation, root-motion, and Animator authority.

{% embed url="<https://youtu.be/xqyHzs6sDIQ>" %}

#### Use the patcher first, then use the setup wizard on your Malbers character.

### Requirements

Before starting, make sure the project has:

* Game Creator 2 Core installed.
* Malbers Animal Controller installed.
* A character GameObject or prefab with `MAnimal`.
* An `Animator` assigned to the Malbers character.
* This Game Creator 2 integration imported.

The `Character`, `MAnimal`, and main `Animator` should be on the same root character GameObject whenever possible.

### 1. Apply The Game Creator 2 Patches

Open the Unity menu:

`Tools > Malbers Animations > GC2 Integration > Patcher`

<figure><img src="/files/hhms6FeJCVL36ygANe6q" alt=""><figcaption></figcaption></figure>

The integration needs these patches because Game Creator 2 must expose and preserve a few animation and movement hooks that the Malbers driver uses. The patcher window explains why the patches are needed, shows the current patch status, and provides buttons to apply, revert, or refresh the patch status.

After the patcher finishes, wait for Unity to recompile.

A healthy setup should show the required patches as `Patched`. If a Game Creator 2 update replaces its source files, open the patcher again and apply the patches.

### 2. Run The Setup Wizard

Open:

`Tools > Malbers Animations > GC2 Integration > Setup Wizard`

<figure><img src="/files/bRlCd9S32361ukFKvn1D" alt=""><figcaption></figcaption></figure>

Drag your Malbers character GameObject or prefab into the `Malbers Character` field and press:

`Setup GC2 Character`

The wizard configures the Game Creator 2 Character for the Malbers integration:

* Adds a `Character` component if one is missing.
* Enables `Is Player`.
* Disables `Motion > Acceleration > Use Acceleration`.
* Sets `Driver` to `Malbers Animal Controller`.
* Sets `Rotation` to `Malbers Pivot`.
* Sets `Animation` to `Malbers Animal Controller`.
* Assigns the root `Animator` to the GC2 animation unit when one is found.

### 3. Verify The Character Inspector

Select the character and check the Game Creator 2 `Character` component.

The important fields are:

| Character Section                        | Expected Value            |
| ---------------------------------------- | ------------------------- |
| Is Player                                | Enabled                   |
| Motion > Acceleration > Use Acceleration | Disabled                  |
| Driver                                   | Malbers Animal Controller |
| Rotation                                 | Malbers Pivot             |
| Animation                                | Malbers Animal Controller |

The Malbers `MAnimal` remains responsible for physical movement, root motion, and the main Animator Controller. Game Creator 2 can still issue movement commands, play States and Gestures, equip weapons, and run visual scripting actions.

### 4. Test Movement

Enter Play Mode and verify that:

* The character moves through the normal Game Creator 2 player input or movement instructions.
* Malbers states, stances, modes, and speeds still work.
* The GC2 Character component does not switch back to the default GC2 Driver, Rotation, or Animation units.

If the character does not move, re-check that `Character` and `MAnimal` are on the same root GameObject and that the patch status is correct.

### 5. Demo Scenes

Demo scenes are included in:

`Assets/Malbers Animations/Integrations/GameCreator2/Scenes/`

Included scenes:

* `Wolf - Forest.unity`: basic Malbers Animal Controller and Game Creator 2 character integration.
* `Steve AI Fetch Ball - GC2 States test.unity`: GC2 States workflow with a Malbers-driven character setup.
* AStarPathfinding - Requires Malbers AStarPathfinding
* Horse Riding - Requires Malbers Horse Riding

Open these scenes after applying the patches and letting Unity recompile.

### 6. Using A\* Pathfinding Or Point & Click

The `Malbers Animal Controller` GC2 Driver can use a path planner for GC2 `MoveToPosition` commands.

For A\* Pathfinding:

* Add Malbers `AStarAIControl` to the Malbers character.

  **Download:** [**https://malbersanimations.gitbook.io/animal-controller/annex/integrations/astar-pathfinding**](https://malbersanimations.gitbook.io/animal-controller/annex/integrations/astar-pathfinding)
* Make sure the required A\* components, such as `RichAI` and `Seeker`, are present and configured.
* On the GC2 `Character` component, open `Driver > Malbers Animal Controller`.
* Set `Pathfinding Backend` to `Malbers AI Control`.
  \*

  ```
  <figure><img src="/files/0j5qh1QXAjMEMVeCrbQj" alt=""><figcaption></figcaption></figure>
  ```
* Assign the `AStarAIControl` component to `Malbers AI Control`.

`AStarAIControl` inherits from Malbers `MAnimalAIControl`, so the same backend also works with the default Malbers AI Control.

For click-to-move player control, set the GC2 `Player` unit to `Point & Click`. `UnitPlayerPointClick` sends a GC2 `MoveToLocation` command, and the Malbers driver converts that destination into a planner destination when the pathfinding backend is enabled.

GC2 movement instructions such as `Move To Location`, `Move To Transform`, and `Move To Marker` use the same path, so they can also use A\* without changing the instruction itself.

### 6. Using GC2 Melee And Shooter Weapons

Game Creator 2 Melee and Shooter weapons can apply GC2 States when equipped. This integration keeps those States layered on top of the Malbers Animator while MAnimal continues to drive locomotion.

#### Animator Update Mode

When a GC2 Player enters a GC2 State, equips a Melee Weapon, or equips a Shooter Weapon, set the character Animator update mode to `Normal` for as long as that GC2 State or weapon State is active.

Use the instruction:

`Malbers > Animator > Set Update Mode`

Set:

* Target: the GC2 Player or Malbers character.
* Update Mode: `Normal`.

When the GC2 Player exits the State, unequips the Melee Weapon, or unequips the Shooter Weapon, run the same instruction again and set:

* Update Mode: `Fixed`.

This is required because Game Creator 2 layers its States and weapon animations through Unity's Playables API. If the Animator stays in `Fixed` while a GC2 State is layered on top of MAnimal, the layered Playables animation can glitch the underlying MAnimal animations.

Default weapon State layers:

* Melee weapon equip States usually use layer `5`.
* Shooter weapon equip States usually use layer `7`.

If you equip a Shooter weapon with `InstructionShooterEquipWeapon` and the weapon model comes from `Last Prop Attached`, attach the prop first:

1. Run `Character > Props > Attach Prop`.
2. Run `Shooter > Equip > Equip Shooter Weapon`.
3. Set the weapon Model field to `Last Prop Attached`.

If the equip instruction runs before the prop is attached, the Shooter weapon has no model target and its State or weapon setup may not become visible.

### 7. Optional Runtime Controls

The integration adds Malbers visual scripting entries under the `Malbers` categories in Game Creator 2.

Common examples:

* `Malbers/Animal`: set sprint, strafe, stance, state, mode, gravity, root motion, locks, and speed.
* `Malbers/Animator/Set Update Mode`: change an Animator between `Normal`, `Fixed`, and `Unscaled Time` at runtime.
* `Malbers/Weapon Manager`: read weapon manager aiming, attacking, reload, combat, riding, and equip states.
* `Malbers/Stats`: read and react to Malbers stats.
* `Malbers/Aim`, `Malbers/Damageable`, and `Malbers/IK`: bridge common Malbers systems into GC2 conditions, events, properties, and instructions.

Use `Malbers/Animator/Set Update Mode` whenever a GC2 State, Melee equip State, or Shooter equip State is layered on top of MAnimal. Set the Animator to `Normal` on enter/equip and restore it to `Fixed` on exit/unequip.

### Troubleshooting

#### The integration does not compile

Run:

`Tools > Malbers Animations > GC2 Integration > Apply Patches`

Then wait for Unity to recompile. If the patcher reports failures, check the Console and the patcher report in:

`Temp/GC2MAnimalPatcherLastReport.txt`

#### The character is stuck or does not move

Check:

* `Character` and `MAnimal` are on the same root GameObject.
* `Driver` is `Malbers Animal Controller`.
* `Motion > Acceleration > Use Acceleration` is disabled.
* `Is Player` is enabled for the player character.
* No other custom script is forcing the GC2 Driver, Rotation, or Animation unit back to a default value.

#### Weapon equip State stays idle

Check:

* Patches are applied.
* `Animation` is `Malbers Animal Controller`.
* The Animator update mode is set to `Normal` while the GC2 weapon State is active.
* The weapon State is assigned on the weapon asset.
* The weapon State layer is not muted by another system.
* For Shooter weapons that use `Last Prop Attached`, the prop is attached before the equip instruction runs.

#### MAnimal animations glitch while a GC2 State is active

Check that the Animator update mode is switched to `Normal` before entering the GC2 State or equipping the GC2 weapon. Restore it to `Fixed` when leaving the State or unequipping the weapon.

#### Mount or dismount animations look wrong

The integration mutes the default GC2 weapon State layers during Malbers mount and dismount transitions so the mount animation can own the transform. If you use custom weapon layers, add those layers to the `Muted State Layers During Mount Dismount` list on the `Malbers Animal Controller` animation unit.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://arawn-software-publishing.gitbook.io/malbers-ac-for-gc2/getting-started/setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
