Gear Switcher (for Bikes) - user-grinch/ModelExtras GitHub Wiki

📋 Overview

The gear lever animation system responds to vehicle gear changes by rotating the lever along the X-axis. You can implement this through two methods: using a specially named dummy or JSONC configuration.

🛣️ Method 1: Dummy Setup

  1. 📌 Create a dummy in your model with this naming pattern:

    x_gearlever_<angle>
    

    Where <angle> is the rotation value in degrees for the X-axis.

  2. Example: For a gear lever that rotates 30 degrees, name the dummy x_gearlever_30.

📄 Method 2: JSONC Configuration

  1. 📁 Create or update a JSONC file in the ModelExtras/data folder
  2. 🏷️ Name the file after your model's numeric ID (e.g., 522.jsonc) or model name (e.g., nrg500.jsonc).
  3. ✏️ Add this structure to your JSONC file:
{
  "gearlever": {
    "offset": 30.0
  }
}

🚗 Visual Example

The gear lever will rotate based on the specified angle when changing gears:

📂 Complete Implementation

For a vehicle with model ID 522 (NRG-500):

  1. 📋 Either:

    • Add a dummy named x_gearlever_30 to your model
    • OR create/update ModelExtras/data/522.jsonc containing:
      {
        "gearlever": {
          "offset": 30.0
        }
      }
  2. 🎮 When your vehicle changes gears, the gear lever will automatically rotate by the specified angle!

⚠️ **GitHub.com Fallback** ⚠️