How Hide, Block, and turn camera on clicking right mouse button?

Hello,

I come to you today because I’ve been trying to run a few things on UnrealEngine for 2-3 days

I would like to have the mouse pointer on the right mouse click not visible, it stays in the center of the screen and the camera can be rotated only on the Z-axis

When we stop clicking we see the mouse pointer, it is again movable and we can no longer turn the camera.

I’m on the TopDown template and here’s what I’ve done so far:



I had managed to put the mouse in the center of the screen at the click, except that the one if does not stay in the center of the screen until the button is released and re-clicked.

Thank you for your help,
I’m sorry about my English, but I use “reverso” to translate.

Create two custom events for “RightMouseButtonPressed” and “RightMouseButtonReleased” - Put the logic for both states into each custom event. On “Pressed” - call “RightMouseButtonPressed” and on “Released” call “RightMouseButtonReleased”

Could you show me an example, please?
I didn’t quite understand.
Thank you for your answer
Here’s what I did the other time but the mouse pointer doesn’t stay in the center of the screen:

Start by pasting your blueprint into here:

It is much easier to read than screenshots.

Thank you so much for your help

In CameraMovement function, put a branch in the beginning and use a bool called “CanMoveCamera”
When you press right mouse button, you set the bool to true and when you release, you set the bool to false. This will turn the camera function on and off.

Thank you very much! That’s exactly what I needed!
I’ll stick the code if it helps anyone else!
Thank you SigmaGames!

You are very welcome.
Why do you need the Gate?

I don’t really know, I tried it that way and it worked, so I left it that way

As they say, if it works, keep it. You made a good choice. Going down the rabbit hole of endless experiments consumes a lot of time. I wish you the very best with your project.