> For the complete documentation index, see [llms.txt](https://hiveminddocs.gitbook.io/hivemind/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hiveminddocs.gitbook.io/hivemind/code-systems/ultimate-train-system/integration-guide.md).

# Integration Guide

## <mark style="color:blue;">**Custom carts mesh setup**</mark>

{% hint style="info" %}
*<mark style="color:red;">**Disclaimer**</mark> <mark style="color:red;"></mark><mark style="color:red;">:</mark> For this to work, you must have a suitable rigged and animated skeletal mesh ready. Which is also scaled to match the rail tracks with their wheels.*\
*This new mesh must have a loopable animation of the wheels spinning in motion.*
{% endhint %}

### **Mesh setup**

Once you have a mesh ready, you need to re-import it with correct offsets

![](/files/NYHOulnYQrjOfqLGmO57)

Your cart mesh has to have it's 0.0.0 center axis on the spot where the rotation hinge will be (the hinge through which it will be connected to the following cart or the locomotive) as it will be the origin of it's rotation as it moves alongthe rail tracks.

![](/files/P6fTI3dg5N4hHw4pl8hD)

Additionally, you'd also want to attach this Hinge mesh attachment at the end of it to allow additional carts to be connected afterwards. You can find this mesh inside ***Content/Train/Meshes*** named as <mark style="color:blue;">**SM\_CLAMP**</mark>**.**

You can do this in your 3D editor or inside the prefab blueprint, it doesn't really matter as long as it's there.

![](/files/TF9Tyr4GY0gWduIuoBCu)

Additionally, you will have to make a new Animation blueprint that has identical logic to **ABP\_CoalCart**

![](/files/S2v9gl0Nt02CIVblIRbc)

You may be able to get away by using an ABP child instance if you rig your custom model under the same skeleton, otherwise you'll have to make a fresh copy and carry over the from the **animgraph**.

### **Blueprint Instance Setup**

![](/files/0gatcscvTo5LE5uSztrI)

Find BP\_CoalCart and Make an **Child Instance Class**, name it whatever you want, it will be your new custom cart.

![](/files/m8s1wyLPee6AebEzsLYw)

![](/files/mjcjqJDBGmtyWLDdznxy)

Open up your new blueprint class. and replace the Skeletal Mesh with your new mesh

![](/files/d5yyYBdY1d4Sk1aKXmXK)

You will also have to swap out the ABP\_CoalCart with your new ABP you made earlier.

![](/files/HvuxdSfeWjtfracTW7HF)

Add this node setup on your **BeginPlay,** (this example has ABP\_CoalCart, this is where you would cast to your new ABP instead) and set the speed to 0 to avoid any glitches.

![](/files/fXVUOqn1d3P3giDhbrRI)

You will also have to setup overrides for the ABP control functions. In this case you only need to Override **Update ABP speed** and **Update ABP rot**

![](/files/ZES0DHaHu0GVsIpSBQor)

Once again, setup the functions in this way (except **use your new ABP instead** of ABP\_CoalCart cast node)

### **Final touches - Variable Setup**

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

\
Now that your mesh and ABP references and functions are ready to go, you need to do the final tuning, find a rotation sweet spot for the Cart Length.\
Try to enter the closest value of the distance from the 0.0.0 point (hooking point) to the back of your cart in centimeters. (you may want to fiddle with the value a bit to get best looking results as it not 100% accurate)

![](/files/NGqjjaPY6jIKtTIj62e4)

Also if your wheel spinning animation speed looks out of sync from the train Locomotive animation speed , you may want to open the Animation asset itself and play with the **Rate Scale variable** until you get a better looking result.

And that's it. Now your cart is ready and you can drop the in the level and add them to the Locomotive cart chain just like the usual carts in the example.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://hiveminddocs.gitbook.io/hivemind/code-systems/ultimate-train-system/integration-guide.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.
