::For the running issue:
How the Boss attacks and movement work is that they are all dependent on it’s Animator.
Every time a new animation plays, the given script plays as it becomes that animation state.
So, what’s likely happening is that your “Boss_Cast” animation’s condition is being met to return back to “Boss_Idle” > “Boss_Run”. This should not be the case as it is being controlled by a Bool Parameter called “Cast”.
Thus, Check your THKEvents.cs & your TheHollowKnight.cs for instances of “Cast” being set to true and then false. Your TheHollowKnight.cs should have a code anim.SetBool("Cast", false);
being set at the very end of it’s Outbreak()
method.
As for the player’s invincibility issue, that’s because the Boss was coded to note take the following function from Enemy.cs that calls for the timestop. This was an intentional, unintentional outcome.
In TheHollowKnight.cs the script has a code “protected override void OnCollisionStay2D(Collision2D _other) { }”
Simply get rid of that code or call the base.OnCollisionStay2d()
.
Because of the “override” code, the proper function is being completely ignored. And the Reason why the Player is taking damage is because THKEvents.cs is calling the TakeDamage()
method in PlayerController.cs directly.