Hello, I am trying to increase the difficulty of my enemies as the layer kills a certain amount of them. I have set up this code in my player controller:
As I reach the threshold required to trigger the Increase Difficulty event, nothing is increased. Same damage, same health. The print statement at the end of the first screenshot is being triggered which makes me think the code is being fully executed but maybe I have the wrong type of reference set up?
It is worth me noting that I use an enemy spawner to continuously spawn enemies (once every 5 seconds) meaning when the level starts there are no enemies in the scene which, I believe, means I cannot make an object reference.
Got this all set up. Would I be right in assuming it is best to do all my difficulty calculations in my player blueprint then get the difficulty inside of the spawner blueprint?
You could but it’s not optimal, unless the project is really small or you’re just experimenting:
the player class should not care about such things, it will be busy doing other, player related things
for defining global difficulty level, it’s common to have a spawn manager / use game mode / game state
it’s quite normal to have it split between a manager that handles global difficulty and the many enemy classes - each doing its own calculations. An Orc Brute will level up differently than a Fire Wizard.