Normally it works fine, but I found a way to break out of the state machine which enables you to fire under water.
This is how I think it works:
When I enter water it enables the sprint animation so it looks like the player is swimming, this is done with:
stateName = "ReadyMotion"; stateTransitionGeneric0In = "SprintEnter"; stateTransitionOnNoMotion = "Ready"; stateWaitForTimeout = false; stateScaleAnimation = false; stateScaleAnimationFP = false; stateSequenceTransitionIn = true; stateSequenceTransitionOut = true; stateTransitionOnNoAmmo = "NoAmmo"; stateTransitionOnTriggerDown = "Fire"; stateSequence = "run";This is the state when the player is moving and you can see the state: "stateTransitionGeneric0In = "SprintEnter";" which is probably what happens when entering water, so when entering water the player is sprinting and cannot fire the weapon or reload and all that stuff.
So now look at the sprinting state itself:
stateName = "Sprinting"; stateTransitionGeneric0Out = "SprintExit"; stateWaitForTimeout = false; stateScaleAnimation = false; stateScaleAnimationFP = false; stateSequenceTransitionIn = true; stateSequenceTransitionOut = true; stateAllowImageChange = false; stateSequence = "sprint";As you can see that the sprinting state has no case where it enters sprinting, so this is why when you manage to enter and dive under water while in the sprint state you will then exit the sprint state and end up back in the ready state, which enables you to fire under water, but as soon as you enter the water surface it will transition to swimming motion again.
So any ideas how to fix that?