Learn how to setup the plugin template
Beat Saber is made in Unity 2018 using C# with .NET framework 4.6.
For convenience, RQ has created a plugin template for Visual Studio. This guide will show you how to setup that template.
Download the latest version of Visual Studio Community.
There are multiple templates that you can choose to install.
The new BS Plugin Template by Kyle1413 includes more options to guide you, as well as a basic use case of CustomUI. We will be using this for the Mod Tutorial.
However, if you wish to go more barebones, here is the older Beat Saber Plugin Template by RQ.
- Open C:\Users\You\Documents\Visual Studio 2017\Templates\ProjectTemplates.
- Drop in
beat-saber-plugin-template.zip. You do not need to extract the contents here, dropping the zipped file will work.
After you have place the zip file in the correct directory, open Visual Studio 2017 and create a new project.
You should see the Beat Saber Plugin Template in the Visual C# section.
Create a new project using the template.
The default assembly name is
NewPlugin depending on the template you downloaded).
To rename the assembly:
- In the Solution Explorer panel, double click on Properties.
- Change the text in the textbox Assembly name.
Changing copy directory
If you are using Kyle1413's BS Template, it comes with a built in post-build event that attempts to copy your built file to:
C:\Program Files (x86)\Steam\steamapps\common\Beat Saber\Plugins
If your Beat Saber install is located here, no worries. If not, we need to change this.
Project, click on
<Project Name> Properties...at the very bottom of the dropdown.
- In the menu that pops up, click
- Replace the last directory in the Post-build event command line (The directory should look like the one above) with the directory to your Plugins folder.
- Save and exit that menu.
Check out the code
In the solution explorer, double click on
Plugin.cs to open it up.
You should see something like this.
Note the red squiggly underlines. This is means Visual Studio can't find our references.
To do this, right click on
References in the Solution Explorer, and select
This will open the Reference Manager window, and you can browse to find the DLL files that are missing.
Most of these files will be located within
\<Beat Saber directory>\Beat Saber_Data\Managed
Some Libraries are located in the Plugins folder as well. Check there for any libraries you forgot to add.
The most popular libraries located in the Plugins folder include:
- Async Twitch
- Beat Saber Utils
Can't find your Beat Saber directory? See install folder.
Compiling the plugin
If you have fixed all of the references in the project, on the top menu bar press
Build -> Build Solution or CTRL + SHIFT + B
Your compiled DLL should appear in the
\Bin\Debug folder of your project.
You can then copy this DLL into the
Plugins folder within your Beat Saber directory.
Check out the example mod tutorial.