How to freeze cursor

How do I freeze cursor??

I have questions answers game,I wanted to freeze cursor as soon I press one answer and animation is played,I wanted it to b frozen until animation has finished playing

I’m not sure you can or should cause the cursor to freeze. It might make the game look frozen. Some platforms allow the mouse to be hidden. Although, I think a hidden cursor still triggers clicks.

A better option might be to add a Boolean that gets checked before the mouse interactions. If all of the affected actions are subevents of it, you just need to check the variable once. Just set it to true while the animation is playing and then back to false when done. Or vice versa depending on your phrasing. I find it easier to name Booleans in the form of a question or statement.