UI requires 2 clicks to register after using right-mouse to rotate

So I am creating a tower defense game and I have a player controller in which I am controlling the player movement. The player is an actor with no collision and only a movement component and a camera attached via a springarm. I am trying to use right-click and drag to rotate the actor and therefore rotate the camera around the actor. This functionality is working as well as movement using WASD, however, after rotating, my UI takes two clicks to activate rather than one. On top of this, it seems that after rotating, when I click on the UI, it is going through the UI and hitting what is behind the UI. I’ve attached a link to an imgur post which shows the parts of my code relevant to rotating using the right-mouse click. Any help would be appreciated.

Link to image of code: Imgur: The magic of the Internet