How to protect games

People how should i make my unity game secure like is there any tool which will secure my game from getting hacked .It is a DESKTOP game as of now.

Would you mind providing some detail instead of just saying hacked?
Also seeing you just joined just a few days ago, how come you created a game that’s being hacked? :eyes:

1 Like

Sorry for the tittle ,auctully I got scared because I am creating a game and suddenly a thought popped up that does unity have some sort of protection for their games .I googled it and the first result which came was unity games can be easily hacked so I got even more scared.I know about the Ixgaurd but it is for mobile application.

Ruchir do you know about anything which will help ?

I myself am not really an expert in this matter but there are a few common practices you can follow:
Like instead of storing your health as

int heath = 100;

You do:

private float _health; // This is health + 5 (or any other no.)
public int Health
{
    get => (int)(health - 5);
    set => health = value + 5;
}

This will discourage player from using things like cheat engine,
Also, There’s this asset Anti-Cheat Toolkit v2 | Utilities Tools | Unity Asset Store
you can search for what you are specifically looking for too
Also, for multiplayer, you can look into server authoritative designs

1 Like

AFAIK the major way to hack your game is using debugging assembly tools like dnspy to get your source code from your compiled game. There are even tutorials on Youtube to learn how. Now I heard that using LI2CPP will prevent that since there are no convenient ways to decompile your game. But since this is posting on Multiplayer, I guess you need to host a dedicated authoritative server for your game.

1 Like

For multiplayer you can look into this article(in the initial comment I forgot that this was a multiplayer forum :p)

2 Likes

So LI2CPP will not work for multiplayer games ? If it will then how to implement it in the game ?

Well I am new to unity so how should I implement the authoritative design in game ?

Any idea about guardingpearsoftware free assets productivity ?

My advice would be go ahead and make the game regardless.

If it gets so popular that hacking becomes a problem, then you’ll be making enough money from it by then that you can pay someone to make it secure.

2 Likes

What kind of hacking are you worried about? If you’re talking about typical multiplayer cheats, like flying through the air, shooting through buildings, etc, you best protect against that by not trusting any information from the client. You do the simulation on the server, and just take inputs from the client. You also verify all of those client inputs on the server.

But that only covers a specific kind of hacking.

1 Like

Look at this

1 Like

Trust me this is the best advice here for you


If it gets so popular that hacking becomes a problem, then you'll be making enough money from it by then that you can pay someone to make it secure.```
1 Like

I am not do worried about them but those ones which interfere with the game codes

Very informative thanks

Yeah I know but if know all of this right now I can implement them when I building the game

Ok guys I was scrolling the project settings and found something called save file names as hashes ,so I wanted to know what does it do if I enable it

@Ruchir @Xentios @rangolee302 how can I enable LI2CPP in game or check if it is there because the articles I read resulted that it is a good way of protecting the game

You can enable IL2CPP in Build Settings > Player Settings > Other Settings by selecting IL2CPP in the Scripting Backend dropdown (You’ll find it under the Configuration heading).

1 Like