Exportation
DynamX allows you to add vehicles (cars, two-wheelers, boats, and helicopters) with .obj format models. Here's a two-part tutorial on how to export them via Blender, configure them, and add them in the game.
Warning
It is strongly recommended to export models via Blender. Models exported, for example, via BlockBench are not optimized and may cause lag.
Model Preparation
Once you have modeled your vehicle in Blender, you need to separate different parts such as wheels or the steering wheel.
-
Chassis Preparation
Everything that makes up the chassis (body, seats, etc.) should be in a part named "chassis."
The vehicle should face in the negative Y direction (see the illustration in wheel preparation).
-
Wheel Preparation
Your .obj file should contain only one wheel model, and the wheel's origin should be placed at the origin of Blender's grid.
The wheel must always be in a separate .obj file from the chassis.
The wheel's rotation should be such that the wheel rotates around the X-axis (red):
Info
If your vehicle uses different wheel models, you'll need to create a separate .obj model for each wheel.
-
Tire Preparation
To allow for punctures, your wheel must have a part (or parts) with "rim" in their name, corresponding to the rim (whether the wheel is flat or not). Other parts will not be rendered when the wheel is punctured.
Warning
If no part containing "rim" is defined, the entire wheel will be rendered even if it is punctured.
Info
Add-ons can provide puncture functionality. If you use DynamX without such an add-on, the wheels cannot be punctured.
-
Steering Wheel Preparation
The steering wheel should be in the same model as the chassis but in a separate object.
The steering wheel's origin should be placed at the origin of Blender's grid.
The rotation of the steering wheel should be such that it rotates around the Y-axis (green):
-
Headlight Preparation
All parts that can be turned on (headlights, emergency lights, etc.) should be in separate objects. Unlike the steering wheel, you can leave them in their place; there's no need to place them at the origin.
-
Motorcycle Preparation
The handlebars should be exported as a steering wheel, and you should create a dedicated object for the fender if you want it to move with the suspension.
Exporting Models
Export all the models you've created in .obj format, along with associated .mtl and .png files, and place them in a folder assets/dynamxmod/models/obj/your_vehicle_name/
in your pack.
Danger
Be careful with the default object name for the chassis provided by Blender (open the exported object with a text editor and check that you have o chassis
or o Chassis
). Do the same for other objects like the steering wheel...
Configuration and In-Game Addition
Visit here: Vehicle Configuration.