Hello! This is a basic guide for adding a custom airship. As an example, we are going to add a working version of the Tolroko Flyer.
First, make sure your Valheim Unity export is properly set up. You are going to be making an asset bundle with your resources. If you have not yet done this, I have a guide here:
Valheim Mod Dev 2.0: How to create asset bundles with custom items (cleaned up reupload)
Next, you will need to set up your asset. Choose a location in the project and create an empty game object. If you are using your own model, import it now. After importing, you can generate the colliders if you want, or make your own that fit your model. To generate them, choose the "Generate Colliders" option on import:
If you generate your colliders, you will most likely need to swap them to convex colliders to work with the rigidbody setup. You can see the "Convex" option on the mesh collider:
After that, add the following 4 scripts and a rigidbody to your base object:
These scripts should have the following settings (with some adjusted to your preference):
The prefabs targeted in the Wear N Tear script should be your base prefab.
Next, add a new object called OnboardTrigger underneath your base object with only a Box Collider that surrounds your ship. This trigger will let the script know if any players are on board. It should look something like this: