How to make an achievement system

Hi everyone, I am trying to make an FPS game and have been trying for the past couple of days to make an achievement system and have no idea what to do as I haven’t worked much with this sort of thing before. If anyone could help me I would greatly appreciate it :slight_smile:

It all depends on what kind of achievements you want to have in your game. For example, I am imagining something such as “kill 10 enemies”. Or “Preform 3 head shots”. Something like this would require several variables. In the actor blueprints of your enemy where ever you have your enemy die you would want to create an integer variable (we’ll call it “EnemyKilled”) that keeps track of the deaths of these enemies. Whenever the player kills one of these enemies you will want to have a branch with a condition to check whether this variable is equal to 10.

If it is false: then you will add 1 to this variable meaning that the player has a new kill.

If it is true: then the achievement has been completed.

After that you could add a widget to the screen and have it appear corresponding to what the player has done. For example, you could have a string and bind it’s data to a variable that you could change depending on what the player has done. For example add data to that variable saying: “Achievement Complete! Killed 10 enemies!”. But that’s just an example. Feel free to contact me if you had something different in mind, or would like a more in depth explanation.

That’s less of a question about how to get achievements working, and more a question about how to identify Damage. If you damage or kill a pawn via the ApplyDamage node, then there’s the option to tell it not only Who caused the damage and What object they used to do it, but also you can designate a Damage Type which is an Enum that you can add more damage types to. That’s one way to do it that is built into the engine, but you can make up your own way too if you want.

what if I want it to be like kill 5 enemies with a machine gun or kill 2 enemies with a sniper, how would I do that?
P.s thanks for all of your help so far I really appreciate it :slight_smile:

I can help you with that, but first I need to know how your guns are firing. How is the hit being detected/registered? (Whenever you fire the gun are you using a raycast/line trace or a spawned in actor to represent the bullet?)

If you have a steam partner acount then you can examine this link.