• Hello
Search Results for

    Show / Hide Table of Contents

    How to start

    This page gets Anti-Cheat into your project. After that, pick a guide for the cheat you care about.

    Step 1 - Install

    Get Anti-Cheat Free or Anti-Cheat Pro from the Asset Store and import it.

    You can also buy Anti-Cheat in the GuardingPearSoftware store, at a discount.

    The AntiCheat folder after import.

    The files live under Assets/GUPS/AntiCheat:

    • Demos are small scenes that show a cheat with and without protection.
    • Resources holds the monitor prefab and the settings asset.
    • Plugins holds the Android and iOS libraries used by Pro.
    • Read_Me.md is a local copy of the start notes. Version_History.md lists what changed in each version.
    Demo What you see Free Pro
    Demo_Memory A score you can try to edit in memory + +
    Demo_DataChain An ordered score that notices a rewritten entry +
    Demo_GameTime A clock you speed up with an external speed hack +
    Demo_DeviceTime A calendar. Change the date in the operating system +
    Demo_AutoClick Two players, and an auto clicker on one gamepad +
    Demo_Android Store, signature, and cheat-app checks +

    Each demo folder has its own ReadMe.

    Step 2 - Project settings

    Open Edit > Project Settings > GuardingPearSoftware > AntiCheat.

    Anti-Cheat settings in the Unity Project Settings window.

    At the top is the Anti-Cheat Monitor field. It holds the monitor prefab that Anti-Cheat adds to your game. Step 3 explains it.

    Below that are four tabs. Global is for settings that apply on every platform. Desktop, Android, and iOS are each for that platform only. You only need the tab for the check you turn on. The guides in step 4 walk through those options.

    Note

    Verify development builds is off on Desktop, Android, and iOS. While it is off, those detectors skip the Editor and development builds so they do not fire while you work.

    Step 3 - The Anti-Cheat Monitor

    The Anti-Cheat Monitor is the object that collects detections and runs punishers. There is one in your game. It stays loaded when you change scenes.

    The monitor lists what is watching, what can detect a cheat, and what can react.

    It is added for you

    You do not have to put the monitor into a scene. When the game starts, Anti-Cheat looks for a monitor. If there is none, it creates one from a prefab.

    Which prefab it uses is set in the Anti-Cheat Monitor field at the top of the project settings:

    • The predefined prefab. This is the default. It is Anti-Cheat-Monitor in Assets/GUPS/AntiCheat/Resources/Prefabs.
    • Your own prefab. Assign any prefab that has the AntiCheatMonitor component on itself or on a child.

    If the field is empty, or the prefab in it has no AntiCheatMonitor, Anti-Cheat falls back to the predefined prefab.

    The predefined Anti-Cheat-Monitor prefab.

    In Pro, the predefined prefab already contains the usual detectors: memory, game time, device time, input, mobile package name, both Android detectors, iOS jailbreak, install source, mod loader, debugger, virtual machine, and instance lock. It has no punisher.

    Use your own prefab

    Make your own prefab when you want other detectors, other detector settings, or punishers.

    1. Copy the predefined prefab, or create an empty GameObject and add the AntiCheatMonitor component.
    2. Add or remove detector and punisher prefabs as children.
    3. Save it as a prefab in your project.
    4. Assign it to the Anti-Cheat Monitor field in the project settings.

    Add the AntiCheatMonitor component.

    You can also place a monitor in your first scene, as before. Anti-Cheat only creates one when it finds none.

    When Anti-Cheat checks for the monitor

    • When the game starts. It checks before and after the first scene loads.
    • When a scene starts. In a built game, every scene checks again. This check does not run in the Unity Editor.

    If the monitor is missing, it is added again from the prefab above.

    A monitor that was there at the start and is gone later was most likely removed by a cheat tool. In a built game, Anti-Cheat adds the monitor again and reports this as a cheat, once.

    Note

    Do not destroy the Anti-Cheat Monitor in your own code. In a built game that counts as a removed monitor.

    More detail: Getting started.

    Step 4 - Pick a cheat to stop

    If the player can... Read this
    Edit score or health in memory Memory protection
    Edit a save file Saved data
    Speed the whole game up Speedhacks
    Move the device date Device clock
    Use an auto clicker Auto clickers
    Share or edit an Android app Protecting an Android build
    Install a cheat app on Android Cheat apps on Android
    Share or edit an iOS app Protecting an iOS build
    Run the game on a jailbroken iPhone or iPad Jailbroken iOS devices
    Use a debugger, mod loader, or virtual machine on desktop, or start the game twice Protecting a desktop build
    Cheat and nothing happens React or Punish

    React when a cheat is found

    The Anti-Cheat Monitor hears every find of every detector and turns them into one threat score. You can react on the monitor, on one detector, or with a punisher.

    On the Anti-Cheat Monitor

    This is the easiest place, because one hook covers all detectors. There are three ways.

    Inspector. The Anti-Cheat Monitor has an On Cheating Detected event. Add a function to it in your own monitor prefab. It runs on every find.

    A script on the monitor. Add a component to the same GameObject as the Anti-Cheat Monitor and give it a method named OnCheatingDetected. The monitor calls it on every find. You do not have to subscribe to anything.

    using GUPS.AntiCheat.Detector;
    using UnityEngine;
    
    public class CheatReporter : MonoBehaviour
    {
        // Called by the Anti-Cheat Monitor on the same GameObject.
        private void OnCheatingDetected(ICheatingDetectionStatus status)
        {
            Debug.LogWarning($"Cheat detected: {status.CheatType}");
        }
    }
    

    Code from anywhere. Add a listener to the same event:

    AntiCheatMonitor.Instance.OnCheatingDetected.AddListener(status =>
    {
        Debug.LogWarning($"Cheat detected: {status.CheatType}");
    });
    

    CheatType tells you what kind of cheat was found, for example Memory, GameTime, or Jailbreak.

    On one detector

    Inspector. On a detector, add a function to On Cheating Detection Event. It runs when that detector finds a cheat.

    Inspector callbacks on a detector.

    Code. Ask the detector:

    var detector = AntiCheatMonitor.Instance.GetDetector<PrimitiveCheatingDetector>();
    
    if (detector != null && detector.PossibleCheatingDetected)
    {
        // A protected value was changed at least once.
    }
    

    With a punisher

    Punisher. Drop a prefab from Assets/GUPS/AntiCheat/Resources/Prefabs/Punishers under the monitor in your own monitor prefab. It runs when the score reaches its limit.

    Built-in punisher prefabs.

    Guides: Reacting to cheating and Punishing cheaters.

    Next

    Continue with the first guide, Getting started, or pick a cheat from the Guides overview.


    Back to the overview.

    In This Article
    Back to top GuardingPearSoftware documentation