Adjusts Unity Time.fixedDeltaTime according to your current refresh rate.
The Time.fixedDeltaTime calculation formula is 1f / current_refresh_rate.
This is mostly enough to solve camera stuttering problems, but it's not a definitive solution for all games that suffer from it, as it directly affects the timing of Unity's physics calculation.
In some cases, this can introduce bugs and also increase CPU consumption and affect performance. The higher the refresh rate, the tighter the timing.
Each game may behave differently, so test it out and see if it's satisfactory.
-
Identify the scripting backend used by the game:
- IL2CPP games usually have a
GameAssembly.dllfile in the game directory. - Mono games have an
Assembly-CSharp.dllfile inside<GameName>_Data/Managedand noGameAssembly.dll.
- IL2CPP games usually have a
-
Install the appropriate BepInEx 6 build for the game's scripting backend, operating system and architecture.
Builds are available from the BepInEx bleeding edge page:
- Mono:
BepInEx-Unity.Mono-<os>-<architecture>-<build>.zip - IL2CPP:
BepInEx-Unity.IL2CPP-<os>-<architecture>-<build>.zip
- Mono:
-
Start the game once so BepInEx can create its directories and configuration files, then close it.
-
Download the asset for the correct scripting backend from the latest release.
-
Extract the archive into the game's
BepInEx/pluginsdirectory. The resulting installation should contain the matching plugin DLL:<GameDirectory>/ └── BepInEx/ └── plugins/ └── UnityFixedDeltaTimeFix.Mono.dllor:
<GameDirectory>/ └── BepInEx/ └── plugins/ └── UnityFixedDeltaTimeFix.IL2CPP.dll
Do not install both versions. BepInEx will load the plugin automatically the next time the game starts.
Just start the game. The plugin keeps Time.fixedDeltaTime synchronized with the current refresh rate.
The repository includes the Unity and IL2CPP compile-time reference assemblies required by both projects, so a game installation is not required to build them.
Install mise, then run:
mise install
mise buildTo create release builds:
mise publishThe outputs are written to:
- Debug builds:
artifacts/bin/<project>/debug - Release builds:
artifacts/publish/<project>/release
Install the .NET 10 SDK and run:
dotnet build UnityFixedDeltaTimeFix.slnx --maxcpucount:1To create release builds:
dotnet publish src/IL2CPP/UnityFixedDeltaTimeFix.IL2CPP.csproj --configuration Release
dotnet publish src/Mono/UnityFixedDeltaTimeFix.Mono.csproj --configuration ReleaseThe bundled IL2CPP reference assemblies target Unity 2020.3.49f1. To compile against another reference pack, set UnityIl2CppInteropDir:
dotnet build src/IL2CPP/UnityFixedDeltaTimeFix.IL2CPP.csproj \
-p:UnityIl2CppInteropDir=/path/to/game/BepInEx/interopThe release workflow runs when a version tag matching the version in Directory.Build.props is pushed. For example:
git tag --annotate 0.1.0 --message "Release 0.1.0"
git push origin 0.1.0The workflow publishes both projects and creates separate Mono and IL2CPP archives in the GitHub release.
To disable the BepInEx console, open BepInEx/config/BepInEx.cfg, find the [Logging.Console] section and set Enabled to false.