A C# modding framework for Mortier FU (Unity 6000.2) that allows you to create custom mods and modify game behavior.
- One of the following:
- .NET SDK 6.0+ (recommended - supports all versions including 9.0)
- OR .NET Framework 4.7.2+ Developer Pack
- IDE:
- JetBrains Rider (recommended)
- OR Visual Studio 2022 (Community edition is free)
- Game:
- Option 1: Mortier FU purchased on Steam
- Option 2: Build from source - The Unity project is available in this repository
- Skills:
- Basic C# knowledge
Note
If you're building from source, you'll find the full Unity project in the /Mortier FU folder.
git clone https://github.com/Asemerald/mortier-fu.git
cd mortier-fuYou need to copy the required Unity assemblies from your game installation to the libs/ folder.
Important
These DLLs are not included in the repository due to Unity's licensing. You must extract them from your own game installation.
Location: <Game Install Path>/Mortier FU_Data/Managed/
Required files:
UnityEngine.dllUnityEngine.CoreModule.dllMortierFu.Runtime.dll(game-specific assembly)
Note
You may need others assembly depending on what you want to achieve, for example you main need the UnityEngine.InputLegacyModule.dll if you want to use user input.
Copy them to:
CustomMod/
└── libs/
├── UnityEngine.dll
├── UnityEngine.CoreModule.dll
└── MortierFu.Runtime.dll
- Open
CustomMod.csprojin Rider - Right-click on the project → Build
- The compiled DLL will be in
bin/Debug/net472/orbin/Release/net472/
dotnet build -c ReleaseTip
Use Release configuration for better performance in production mods.
Copy the compiled CustomMod.dll to your game's mod folder:
<Game Install Path>/Mods/CustomMod.dll
Note
The exact mod folder location may vary depending on your modding framework. Check your mod loader documentation.
using UnityEngine;
using Mortierfu;
namespace CustomMod
{
public class MyFirstMod : MonoBehaviour
{
void Start()
{
Debug.Log("My first mod loaded!");
}
void Update()
{
// Your mod logic here
}
}
}Increases player movement speed by 50%:
using UnityEngine;
namespace CustomMod
{
public class SpeedMod : MonoBehaviour
{
private float speedMultiplier = 1.5f;
void Update()
{
var player = GameObject.FindWithTag("Player");
if (player != null)
{
var rb = player.GetComponent<Rigidbody>();
if (rb != null && Input.GetKey(KeyCode.W))
{
rb.velocity *= speedMultiplier;
}
}
}
}
}Warning
Modifying physics values can cause unexpected behavior. Always test thoroughly!
Shows player position and FPS on screen:
using UnityEngine;
namespace CustomMod
{
public class DebugInfoMod : MonoBehaviour
{
private float deltaTime = 0.0f;
void Update()
{
deltaTime += (Time.unscaledDeltaTime - deltaTime) * 0.1f;
}
void OnGUI()
{
var player = GameObject.FindWithTag("Player");
if (player != null)
{
var position = player.transform.position;
var fps = 1.0f / deltaTime;
GUI.Label(new Rect(10, 10, 300, 20), $"Position: {position}");
GUI.Label(new Rect(10, 30, 300, 20), $"FPS: {fps:0.}");
}
}
}
}Teleports player to spawn on pressing F5:
using UnityEngine;
namespace CustomMod
{
public class TeleportMod : MonoBehaviour
{
private Vector3 spawnPoint = new Vector3(0, 10, 0);
void Update()
{
if (Input.GetKeyDown(KeyCode.F5))
{
var player = GameObject.FindWithTag("Player");
if (player != null)
{
player.transform.position = spawnPoint;
Debug.Log("Teleported to spawn!");
}
}
}
}
}Tip
Use Input.GetKeyDown() for single-press actions and Input.GetKey() for continuous actions.
Error: "Could not find UnityEngine.dll"
- Make sure you've copied all required DLLs to the
libs/folder - Check that the paths in
.csprojare correct
Error: "MSB3277 netstandard version conflict"
- This has been fixed by targeting
net472instead ofnet462 - If you still see it, verify your
.csprojhas<TargetFramework>net472</TargetFramework>
Mod doesn't load in game:
- Verify the DLL is in the correct mods folder
- Check game logs for error messages
- Ensure your mod class inherits from
MonoBehaviour
Game crashes on startup:
- Check for infinite loops in
Start()orAwake() - Verify you're not accessing null references
- Use try-catch blocks during development
Caution
Always backup your game saves before testing new mods!
Happy Modding! 🎮