I am having a bit trouble to understand how inherited works. In my game, I have created an enemy A, when A detects the player, it runs towards the player and hit it. Then there is an enemy B, I made it an inherited scene from A, and extend the A script to make script B.
Basically, B has the same behaviour as A, only when in a Chase state, I want B to stay in current position and shoot instead of going towards the player. However, I am not sure how to rewrite the codes for chase state in script B that overrides the code in base script A.
I just copy the code from Chase state from A to B, update the code, but enemy B still follows some behaviour from script A. In case like this, what is a good way to update codes for enemy B? Thank you.