I have a character game object, with both an animator and a collider.
Whenever the animator is on, the collider cannot be changed during run-time, though it can be changed in scene editing mode, via the inspector.
No matter what animator properties I change via the inspector, nothing happens. The feature I've tried to fix was invincibility frames - A co-routine, disabling the character's hit-box for several seconds.
I attempted enabling and disabling the collider's isTrigger property, but the problem persisted - The character still gets hurt while the isTrigger is on.
Code:
private IEnumerator ActivateInvincibility()
{
// 3 seconds of invincibility
_hit_zone.enabled = false; // no effect
_hit_zone.isTrigger = true; // no effect either
yield return new WaitForSeconds(3f);
_hit_zone.enabled = true;
_hit_zone.isTrigger = false;;
}
Called normally, like so: StartCoroutine("ActivateInvincibility");
.
Edit:
For clarification, what I want to know is the root of the problem I've encountered, because I suspect more problems could occur because of this one root.
I have also edited out the unimportant lines of code.