When pressing left mouse button it doesn't run the animation I want.

This just flips the boolean on and off.
Check where your code is testing against this boolean to trigger the animation