Spoilers (for Vehicles) - user-grinch/ModelExtras GitHub Wiki

🏎️ Spoiler System

The Spoiler system allows vehicle components to automatically deploy or adjust their angle once a specific speed threshold is met. This adds a layer of realism and mechanical polish to high-performance vehicle models. ME monitors vehicle velocity in real-time. Once the Trigger Speed is surpassed, the spoiler interpolates from its default position to the specified Rotation angle over a set Time duration.

There are two ways to implement this:

  1. JSONC Configuration: The preferred method for easy adjustments without re-exporting the model.
  2. Model Dummies: You can encode rotation and time data directly into the model dummy names for "plug-and-play" assets.

⚙️ Use a JSONC file (JSON with Comments) to configuration

📂 File Location & Structure

📌 Path: ModelExtras/data/<FILENAME>.jsonc or modloader/AnyFolder/<FILENAME>.jsonc

Both model ID and model name are valid FILENAME (e.g. 602.jsonc or alpha.jsonc).
💡Tip: It is recommended to use model names instead of model IDs to avoid conflicts with other mods — especially when using added vehicles.

⚠️​ Attention:

Every JSONC configuration requires a metadata specification before any other settings. See here: METADATA

➡️ Use the structure below to map animation properties to specific model parts.

{
  "spoilers": {
    "movspoiler": {         // Must match the dummy name in the model
      "rotation": 30.0,     // Target angle in degrees
      "time": 3000,         // Animation duration in milliseconds
      "triggerspeed": 20    // Activation speed in km/h
    }
  }
}
⚠️ **GitHub.com Fallback** ⚠️