atlasgames-repo / fortress-defense

The unity fortress defense project
7 stars 0 forks source link

PirateBoar Bug #107

Closed Russell2023 closed 8 months ago

Russell2023 commented 8 months ago

One of the enemies called pirate boar has several errors after its death.

Error1: '[ Enemy ] PirateBoar - Range(Clone)' AnimationEvent 'SetHead' on animation 'Death' has no receiver! Are you missing a component?

Error2: NullReferenceException: Object reference not set to an instance of an object SmartEnemyGrounded.CheckAttack () (at Assets/_FD/Script/SmartEnemy/SmartEnemyGrounded.cs:219) SmartEnemyGrounded.LateUpdate () (at Assets/_FD/Script/SmartEnemy/SmartEnemyGrounded.cs:146)

m-nt commented 8 months ago

In file Assets/_FD/Script/SmartEnemy/SmartEnemyGrounded.cs:219 as followed :

//CHECK AND CALL MINION IF THIS ENEMY HAS SCRIPT CALLMINION
    switch (attackType) {
        case ATTACKTYPE.RANGE:
            if (rangeAttack.AllowAction())

its checking for enemy atack type, check enemy prefab for Attack type component (range attack type)

Russell2023 commented 8 months ago

but the code in cs:219 is in this format:

if (meleeAttack.AllowAction()) { if (meleeAttack.CheckPlayer(isFacingRight())) { SetEnemyState(ENEMYSTATE.ATTACK); meleeAttack.Action(); AnimSetTrigger("melee"); SetSkeletonAnimation(ANIMATION_STATE.ATTACK, true); }

Russell2023 commented 8 months ago

are you talking about the Throw Attack script?

m-nt commented 8 months ago

Yes I know, the error (NullReferenceException) referes to the attack type component

Russell2023 commented 8 months ago

ok I checked the script. should I change something?

Russell2023 commented 8 months ago

everything looks fine except the death sound which is missing.

m-nt commented 8 months ago

@Russell2023 any results ?

Russell2023 commented 8 months ago

No results till now. I've tried several methods and none of them seem to work. Here is a picture of that cursed event.

![Uploading fortress-defense - Playing atlas Test - PC, Mac & Linux Standalone - Unity 2020.2.5f1 Personal DX11 1_13_2024 12_23_52 PM.png…]()

m-nt commented 8 months ago

fixed in https://github.com/atlasgames-repo/fortress-defense/pull/108