It appears to me that player.animation.IsPlaying("Fishing_Cast") is always resolving to false and so on the first frame you press E, hasCast is false and so it does lines 3 and 4, but then the following frame, because you are still pressing E, hasCast is now true and the script executes line 8.
A better solution would be to use an animation controller so that you don't have to hard code things like "Fishing_Cast" and "Fishing"
↧