📖 Tutorial Unity Mod Menu for Android (Better version)

Sbenny.com is trusted by 1,326,498 happy users since 2014.
Register

AndnixSH

Savage Lv6️⃣
SB Mod Squad ⭐
Member for 8 years
Video preview: Mod Menu Android Preview - Streamable

I have impoved the flat menu with the following changes:
- Auto resize width
- Auto resize height wieh adding/removing buttons
- Note/warning box
- Better dragging menu by bringing back WindowFunction
If you already using flat mod menu, please use the new code.


Download source code:
AndnixSH/UnityModMenuAndroid

You can use the code whatever you want without crediting to me. It’s not copyrighted or licensed
Please note, you must have basic knowledge of C# and Unity. I won’t explain everything in it.

And don’t forget the read everything, being lazy to read and skipping will cause yourself to do bad things. And if you still have question after fully reading, just ask.

Using Unity editor to customize and test:
It’s better to customize it in Unity editor and test. You can edit code while the scene is playing

First, create an account or sign in with Google or Facebook at Unity
Go to Store - Unity Store and select "Try personal". It is completely free. Download and install it. If you like to have Visaul Studio 2017 installed, make sure to select it in installer. If not installed, you will use MonoDevelop.
Launch Unity, login with your account and complete your survey. After that you can create a new project. Name it you want and keep 3D selected and disable Unity Analytics. Click "Create project"

To add the existing script, simply drop the .cs file on Protect/Assets section

Everything are explained in source code

It’s recommended to create MOD Menu script each games you want to mod like I do so you have your scripts ready for modding:



How to add mod menu into the game:
This is a tricky part because you need to find classes that are active. it’s hard to find, but there are ways to find out and add OnGUI.

- Known active classes are UIRoot, UIDrawcall, SoundManager, AudioManager, Loading classes etc... The best are SoundManager, AudioManager or something similar

- Search for any "Start" or "Awake" method, add this code and change first number +50 each Classes that have "Start" or "Awake" method to find out what classes is active and best

C#:
void OnGUI() {
GUI.Button(new Rect(0,0,200,50), "FirstClassName");
}
C#:
void OnGUI() {
GUI.Button(new Rect(50,0,200,50), "FirstClassName2");
}
C#:
void OnGUI() {
GUI.Button(new Rect(100,0,200,50), "FirstClassName3");
}
You can just edit any method and add OnGUI code above and it will add into Class



If the button is too dark, that’s a bad class.

In this case, i’m modding Baldi’s Basics and added OnGUI to PlayerScript, PlaytimeScript and ScoreScript. Only 1 button “PlayerScript” appear on screen so we know it’s an active class



If you found a good active class that isn’t bad, you can start adding MOD Menu

Right click on empty namespace and click Add Class...



Add your whole code. Make sure the OnGUI() and Update() is “public static” so other classes can access the fields. Click Compile

dnSpy can't find class you created so you have to save the assembly as Assembly-CSharp.dll in Managed folder. Unload Assembly-CSharp.dll and reload Assembly-CSharp.dll file

Now call OnGUI and Update on active class to your MOD Menu

On active class, if OnGUI() or Update() does not exists, just edit one of method and add new method above or below existing method:

C#:
public void OnGUI()
{
    YourModMenu.OnGUI();
}
If OnGUI() exists, edit it and only add
C#:
YourModMenu.OnGUI();


Hacking functions with mod menu
Now search some functions to hack. If you had added OnGUI in an existing class with Instance method, modify the code like this:
In this case, I modify getter method

C#:
public float ArmorCapacity
{
    get
    {
        if (YourModMenu.toggle1)
        {
            return 999f;
        }
        return this._armorCapacity;
    }
}
And In void

C#:
private void Success()
{
   if (YourModMenu.toggle2)
   {
       if (this.jumps >= 10)
       {
       // success code
       }
   }
   else if (this.jumps >= 5)
   {
   // success code
   }
}


There are many ways to modify

Save the dll file and test your MOD Menu

Good luck :)

Preview:
 
Last edited:

MarkGearVR

Lurker Lv0️⃣
Member for 5 years
HI mate i have unity and i dont know where is put the script, i have made an empty game object and added the script to it but when i press play it doesnt show, any mor einfo please my friend thanks
 

AndnixSH

Savage Lv6️⃣
SB Mod Squad ⭐
Member for 8 years
Thread updated. Dropped old MOD Menu with the new one
 

Marshall

Savage Lv6️⃣
Member for 5 years
Hi your draggable flat MOD Menu template looks awesome I'll try to use it some day when I can 😊
 

AndnixSH

Savage Lv6️⃣
SB Mod Squad ⭐
Member for 8 years
Thread updated. Please read and download improved code
 

xyummyx

Droidstein Lv8️⃣
Member for 5 years
@Tigress I learn all the menu from this guy. I still haven't master it, still a newbie...lol
 

Tigress

~ Hack Genius ~
✔ Approved Releaser
Member for 5 years
@xyummyx, currently facing a problem while trying to add to a previous class.
1549199150935.png


NOTE: I already added a class.

1549199344151.png
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
Going to try 😊
 
Top