Setting up a mod in Unity

The SDK is also available through the public Unity package registry, which lets you browse and select tagged SDK versions in Unity. See Install and update the SDK from the Unity registry. The SDK Manager steps below still cover creating a project and importing the game.

1. Download the SDK Manager

From the link below download redux-sdk-gui.exe

https://github.com/KSP2Redux/Redux-SDK-Manager/releases/latest

2. Launch the SDK Manager

Launch it, and make sure to download any dependencies it will prompt you about - those being Unity Hub, and Git, it will open installation links in your browser if you press yes

After you launch it you should be at a screen like this (without any mods of course)


3. Install the correct unity version through the SDK manager

Go to the versions tab and beside each SDK version there should be an install button if you do not have the unity version for that SDK version - to see snapshot versions enable them in the settings (the cog wheel)

You want to install the version most closely matching your current Redux install version

4. Create a new Unity Project in the SDK Manager for your mods

Press the green New button at the top and select the version of Redux you have (if you have a snapshot version, first enable snapshot versions in the settings - the cog wheel)

Then select an empty folder to put your new mod in, and give it a name

After you are done creating the mod, you just need to wait for the project setup to complete which should take about 5-10 minutes (it’s automatically importing KSP2 into the editor for you), if this fails, install the correct unity/redux versions then press setup next to the project after all that is done, and if that still fails follow the steps listed in Setting up the thunderkit import manually after you open unity before step 6

5. Open the project using the SDK manager

Press the green open button - it should open using the correct unity version automatically

6. Creating a Mod

  1. Go to Modding > Create New Mod in the toolbar


  2. Fill out the Mod Id field, it is highly recommended to use PascalCase for the ModId, that is: no spaces or special characters, and the first letter of every word being uppercase.

  3. If you know that your mod is going to have code, check Add Code To Mod, you can always change this later

  4. Finally press Create, it should create a folder in assets with the Id you gave the mod

  5. Navigate to your mod folder, and click on the asset named after your newly created mod, in the inspector fill out Name, Author, and Description


  6. If some content of your mod is optional per campaign, declare it in the Features section of the same inspector. The feature of your mod is pinned at the top. To add more features, click + Add Feature. See Campaign features.

6. Testing your mod

  1. Open up the Redux SDK window by going to Modding > Redux SDK in the toolbar

    (Need to update image, but where it says "KSP2 Unity Tools" is now "Redux SDK")

    (Need to update image, but where it says "KSP2 Unity Tools" is now "Redux SDK")


  2. Click the checkbox next to your mod, then Test Selected Mods in Editor, you can also use Test In Editor from the swinfo asset for your mod as well

  3. When the game boots, you should see your mod in the Mods menu

  4. To see the content of your mod in a campaign, turn the mod on for that campaign. A newly installed mod is on at the main menu, but it is off in campaigns. To turn it on, do one of these steps:

    • Before you start a new campaign, select the mod in the Mods menu and mark it under Default Features.

    • On the new campaign menu, press Edit Pack and turn the mod on.

    When an existing save loads, it asks you to add your mod.

7. Deploying

You can either use the Redux SDK menu, or the mod info asset to deploy your mod to a zip file that you can publish anywhere. Click on Deploy Selected Mods To Zip File and you will find your built mod in Deploy/YourModName.zip in your project root (outside of Assets, so it won't be visible in Unity).

Adding External Mod Dependencies

Create a Mods folder under your Assets directory if there isn't one already, and extract any external mod dependencies into folders in there, this functions exactly like KSP2's mod folder.

Publicizing KSP2 Redux

Sometimes you need to access private members in the game code, this would normally require reflection, but the Redux template provides an alternative, it ships with a script that will make all private members in the imported game code public for access from your code, to invoke this script go to Modding > Publicize Assembly-CSharp.dll.