Setting up Unity: Difference between revisions
Jump to navigation
Jump to search
Spacewarp>Safarte Unity project creation instructions and page cleanup |
Dandoesstuff (talk | contribs) mNo edit summary |
||
| (6 intermediate revisions by 3 users not shown) | |||
| Line 6: | Line 6: | ||
# 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. | # 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. | ||
# Download and install Git from https://git-scm.com/downloads. | # Download and install Git from https://git-scm.com/downloads. | ||
# Download/Clone/Use the Redux.Template repo from https://github.com/KSP2Redux/Redux.Template | |||
== Initializing the Unity project == | == Initializing the Unity project == | ||
# Open '''Unity Hub'''. | # Open '''Unity Hub'''. | ||
# Click on ''' | # Click on '''Add''' at the top right of the window. | ||
# | # Click on '''Add project from disk.''' | ||
# Select the Redux template you downloaded. | |||
# | |||
== Configuring the Unity project == | == Configuring the Unity project == | ||
=== | === Configuring ThunderKit === | ||
Unity | ''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 | ||
# The ''ThunderKit'' Settings window should open, if it doesn’t, just go to '''Tools>ThunderKit>Settings''' in the toolbar at the top of Unity. | # The ''ThunderKit'' Settings window should open, if it doesn’t, just go to '''Tools>ThunderKit>Settings''' in the toolbar at the top of Unity. | ||
# 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 <code><KSP2 root folder>/KSP2_x64.exe</code>. '''Note: This must be a Redux install of the game.''' | |||
# 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 <code><KSP2 root folder>/KSP2_x64.exe</code>. | |||
# Click '''Import''' and wait for KSP2 to be imported. If asked, click '''I made a backup, Go Ahead'''. | # Click '''Import''' and wait for KSP2 to be imported. If asked, click '''I made a backup, Go Ahead'''. | ||
# If Unity asks you to restart your project, confirm it by clicking on '''Restart Project'''. | # If Unity asks you to restart your project, confirm it by clicking on '''Restart Project'''. | ||
# 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''' | # 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.''' | ||
# Once you've confirmed that Core Part Data is there, you now have to browse to '''Assets -> and find ImportKsp2ToEditor.''' | |||
# Once you've found ImportKsp2ToEditor, click on it and press '''Execute.''' | |||
# | |||
=== | === Creating a mod and setting up swinfo.json === | ||
# | # Go to '''Modding>KSP2 Unity Tools.''' | ||
# | # Click Create Mod | ||
# | # Give the mod a ModId and if you want a small code template in your mod, click '''Add Code to Mod.''' | ||
# Click Create. | |||
# | # 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. | ||
# | # Setting up swinfo is simple. Select swinfo.asset and edit all the values to your liking. | ||
# | # If you want to test your mod in the editor, navigate to KSP2 Unity Tools, select your mod and then click '''Test Selected Mods in Editor.''' | ||
# Once you've finished your mod and are ready to distribute it, you will have to export it. Select the mod in KSP2 Unity Tools and then click '''Deploy Selected Mods To Zip File.''' | |||
# | # The mod will then be stored in the Redux.Template in a folder called "Deploy". You will then have to share the zip on SpaceDock or whichever other websites you please. | ||
# | |||
[[Category:Getting started]] | [[Category:Getting started]] | ||
Latest revision as of 18:28, 16 November 2025
This page will help you install everything you need to use Unity for KSP2 modding.
Installing Unity
- Download Unity Hub from https://unity.com/download.
- 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.
- Download and install Git from https://git-scm.com/downloads.
- Download/Clone/Use the Redux.Template repo from https://github.com/KSP2Redux/Redux.Template
Initializing the Unity project
- Open Unity Hub.
- Click on Add at the top right of the window.
- Click on Add project from disk.
- 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
- The ThunderKit Settings window should open, if it doesn’t, just go to Tools>ThunderKit>Settings in the toolbar at the top of Unity.
- 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. - Click Import and wait for KSP2 to be imported. If asked, click I made a backup, Go Ahead.
- If Unity asks you to restart your project, confirm it by clicking on Restart Project.
- 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.
- Once you've confirmed that Core Part Data is there, you now have to browse to Assets -> and find ImportKsp2ToEditor.
- Once you've found ImportKsp2ToEditor, click on it and press Execute.
Creating a mod and setting up swinfo.json
- Go to Modding>KSP2 Unity Tools.
- Click Create Mod
- Give the mod a ModId and if you want a small code template in your mod, click Add Code to Mod.
- Click Create.
- 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.
- Setting up swinfo is simple. Select swinfo.asset and edit all the values to your liking.
- If you want to test your mod in the editor, navigate to KSP2 Unity Tools, select your mod and then click Test Selected Mods in Editor.
- Once you've finished your mod and are ready to distribute it, you will have to export it. Select the mod in KSP2 Unity Tools and then click Deploy Selected Mods To Zip File.
- The mod will then be stored in the Redux.Template in a folder called "Deploy". You will then have to share the zip on SpaceDock or whichever other websites you please.