Setting up Unity

From Kerbal Space Program 2 Modding Wiki
Revision as of 18:15, 16 November 2025 by Dandoesstuff (talk | contribs)
Jump to navigation Jump to search

This page will help you install everything you need to use Unity for KSP2 modding.

Installing Unity

  1. Download Unity Hub from https://unity.com/download.
  2. Download Unity 2022.3.5f1 by clicking on the Install this version with Unity Hub link on this page: https://unity.com/releases/editor/whats-new/2022.3.5.
  3. Download and install Git from https://git-scm.com/downloads.
  4. Download/Clone the Redux.Template repo from https://github.com/KSP2Redux/Redux.Template

Initializing the Unity project

  1. Open Unity Hub.
  2. Click on Add at the top right of the window.
  3. Click on Add project from disk.
  4. Select the Redux template you downloaded.

Configuring the Unity project

Configuring ThunderKit

ThunderKit is a package for Unity which we use to import the game's components into the Unity editor. This is included with the Redux Template

  1. The ThunderKit Settings window should open, if it doesn’t, just go to Tools>ThunderKit>Settings in the toolbar at the top of Unity.
  2. Go to ThunderKit Settings and in Locate and load game files for project, click on Browse and select your main Kerbal Space Program 2 executable found at <KSP2 root folder>/KSP2_x64.exe. Note: This must be a Redux install of the game.
  3. Click Import and wait for KSP2 to be imported. If asked, click I made a backup, Go Ahead.
  4. If Unity asks you to restart your project, confirm it by clicking on Restart Project.
  5. After the process is finished, to check if the game was correctly imported, select or create any game object and in the inspector click Add Component and search for Core Part Data.
  6. Once you've confirmed that Core Part Data is there, you now have to browse to Packages -> KSP2 Unity Tools -> and find ImportKsp2ToEditor.
  7. Copy ImportKsp2ToEditor to Assets, and then click on that copy and press Execute.

Creating a mod and setting up swinfo.json

  1. Go to Modding>KSP2 Unity Tools.
  2. Click Create Mod
  3. Give the mod a ModId and if you want a small code template in your mod, click Add Code to Mod.
  4. Click Create.
  5. You should now have a folder with your mod name with a swinfo asset, Pipelines folder and if you ticked Add Code to Mod, a Code folder.
  6. Setting up swinfo is simple. Select swinfo.asset and edit all the values to your liking.
  7. Once you've finished your mod, you will have to export it. Select the mod in KSP2 Unity Tools and then click Deploy Selected Mods To Zip File.
  8. The mod will then be stored in the Redux.Template in a folder called "Deploy". Place this folder in the "mods" folder and test out your mod in game.