OnStateEnter and OnStateUpdate NullReferenceException

Please use code-tags when posting code. You must be able to see that the above is a huge wall of text that is very hard to follow.

Whatever the reason you get this exception, the cause is always the same and it’s the most posted problem because it’s a basic C# problem, not a Unity problem and not related to state-machines or anything else.

You’ve simply got a field or property you’ve not initialized so is NULL. The error tells you exactly which line/column this is but we don’t know that because you didn’t post the full error and couldn’t figure out the line because it’s all plain text. Go to that line and see what’s actually NULL, it’s easy to do. Then figure out why it’s not been initialized.

I see an awful lot of GetComponents which you are assuming are there but if they’re not then they return NULL and then you proceed to use them even if that are NULL. The line/column number reported will tell you though where it is.