Search Unity

Damage Colliders Staying Open When Action Interrupted

Discussion in 'Scripting' started by AnimusRex, Jun 14, 2020.

  1. AnimusRex

    AnimusRex

    Joined:
    Apr 26, 2019
    Posts:
    67
    I have a script for the player controller:
    https://hatebin.com/vhusjbvpgc

    And a script for the AI enemy controller:
    https://hatebin.com/uzeeyvqtkg

    I'm currently able to interrupt an enemies attack, and their damage collider stays open. Line 322-324 on the aIController, I think that the currentSnapshot is set to null for some reason as I hit them, before it turns the damage collider off, but I can't figure out why.

    If there are any other scripts you'd need to see, such as the damagecollider, action snapshot, etc, just let me know.

    The hitboxes are turned off and on using animation events, but should automatically get turned off if that character is hit with an attack.

    Any input appreciated, been stuck on this for almost a week now.

    Thank you!