I just completed the Lazy Intialisation lesson, but now my enemies are no longer attacking the player while within chase distance. To debug, I put print statements in both CanAttack and AttackBehaviour, but neither are printing. Since we didn’t directly edit the attack state, but rather currentWeapon and guardPosition, I am not sure what my next step to debugging should be.
After a TON of debugging, I realized I just made a really stupid mistake. Following up here for anyone else who may hit the same problem. In my Fighter script, SetUpDefaultWeapon method, I had
private Weapon SetupDefaultWeapon()
{
AttatchWeapon(defaultWeapon);
return default;
}
Instead of
private Weapon SetupDefaultWeapon()
{
AttatchWeapon(defaultWeapon);
return defaultWeapon;
}
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.