duck123
Recruit
Hi,
I have written code to deal damage to an agent when they get too close to an object. The code works however when the player dies the game crashes. There are alot of options I could set and im not sure what I need to in order to get a proper death and avoid a crash, all im doing now is:
AttackCollisionData damageData = new AttackCollisionData();
damageBlow = new Blow(gameAgent.Index);
damageBlow.InflictedDamage = 1;
gameAgent.RegisterBlow(damageBlow, in damageData);
Basically the idea is that the damage is being delt by the player against themselves, kind of like how if you fall to your death I assume thats self inflicted.
I have written code to deal damage to an agent when they get too close to an object. The code works however when the player dies the game crashes. There are alot of options I could set and im not sure what I need to in order to get a proper death and avoid a crash, all im doing now is:
AttackCollisionData damageData = new AttackCollisionData();
damageBlow = new Blow(gameAgent.Index);
damageBlow.InflictedDamage = 1;
gameAgent.RegisterBlow(damageBlow, in damageData);
Basically the idea is that the damage is being delt by the player against themselves, kind of like how if you fall to your death I assume thats self inflicted.