How do I disable left mouse rotation from PlayerCameraManager?

I am trying to replicate the movement of the game Black and White who’s camera movement is pretty much like the editor of UE4 itself.

I have managed to simply do this using a new custom player controller. However it also triggers from left mouse. Also it descends from the ctrl key and I want to disable both (and to enable/disable other things).

How would one do this?

Could you explain it a bit further?

@mindfane Sure. WASD to move relative to where you are looking at, Q/E to move vertically, holding right-click to look around as you would in an FPS, click to interact with things and perhaps rightclick ONCE to show rightclick context. I have played with UE4 but not at all with the camera / game controller / game state section as its way too vast to experiment on my own :expressionless:

Ok I think its a good idea to first implement this with Blueprints and once you got everything right, adapt it to C++. Blueprints are much faster when it comes to prototyping.

Here is how I would try to achieve it.
I will create a new blueprint extended from Pawn. with the following general component setup.

  1. An arrow component as root (for visual purposes only)
  2. A spring arm under the arrow component (optional)
  3. A camera component under spring-arm (if you have it) or directly under arrow.

Setup the Axis and Action bindings.

The idea is to manipulate the position and rotation of the Pawn. Since the camera is attached to the pawn, it will move along with it. For instance, when I press ‘Q’, I will move the Pawn along positive camera Z axis. How you would move your Pawn is entirely upto you.

Once that is done, you might want to create a new Player controller and Game mode. Set this new Pawn as the default pawn. In the project properties, set this new controller and game mode as the defaults. Once that is done, when you press ‘Play’, you will be seeing through the eyes of this pawn’s camera.

Try if you can get it working. If you are having trouble, let me know and I will se if I can setup a demo for you (might take a day or two though, I am busy with some work)

Ok I think its a good idea to first implement this with Blueprints and once you got everything right, adapt it to C++. Blueprints are much faster when it comes to prototyping.

Here is how I would try to achieve it.
I will create a new blueprint extended from Pawn. with the following general component setup.

  1. An arrow component as root (for visual purposes only)
  2. A spring arm under the arrow component (optional)
  3. A camera component under spring-arm (if you have it) or directly under arrow.

Setup the Axis and Action bindings.

The idea is to manipulate the position and rotation of the Pawn. Since the camera is attached to the pawn, it will move along with it. For instance, when I press ‘Q’, I will move the Pawn along positive camera Z axis. How you would move your Pawn is entirely upto you.

Once that is done, you might want to create a new Player controller and Game mode. Set this new Pawn as the default pawn. In the project properties, set this new controller and game mode as the defaults. Once that is done, when you press ‘Play’, you will be seeing through the eyes of this pawn’s camera.

Try if you can get it working. If you are having trouble, let me know and I will se if I can setup a demo for you (might take a day or two though, I am busy with some work)

EDIT: I got some free time today. I set up a demo (not sure this is what you had in mind). I’m posting the compoenet setup and blueprints
Blueprint part1:

Blueprint part2:

With this setup, the camera will move when you hold Right mouse button and press W-A-S-D. It will rotate when you drag up or down. I have not implemented Q-E up-down. But its pretty easy to implement. If you are interested, I will try and post more screenshots

@midfane Still at work, will play once I get home. Aren’t you rotating the camera around the pawn with the mouse? In your method, I would want to rotate the Pawn/Center/ArrowHelper with the camera in the center of the describing sphere.

Not sure what you mean exactly. But what I am doing is rotating the Pawn itself. Since the camera is a sub-component of the Pawn, it will follow the rotation of Pawn.
If you want the camera to overlap with the Pawn (thus being at the center), you can reduce the spring-arm length to a very small value.
The thing to note here is technically I am not meddling with the camera directly. And secondly, the Pawn is invisible (it does not have any visible component attached to it). But for debugging purposes, you can set the Arrow component to ‘Draw in game’ and see a visual representation of the pawn.

@mindfane I made the WASD work but the rotation does not work. I don’t want to have a spring, just the camera. I did like in your screenshots, but nothing happens

Having spring-arm is entirely upto you.

Can you explain what happens when you try to rotate? Please remeber that with my implementation, you must hold the right-mouse button and then drag to rotate.

Also you need two axis bindings defined in the Project settings.

These are

  1. MouseDragX (bound to MouseX)
  2. MouseDragY (bound to MouseY)

If it is still not working, let me see your blueprint and Input bindings.

PS: Also remember to turn off ** ‘Use Controller rotation’ ** option in Camera properties.

ah, the last option i forgot to put. also I used “add yaw” component instead of getting, adding then setting the new value

Hello.
So did you manage to get ti working?
If the issue is solved, dont forget to mark it as Solved.

Thanks

I was able to get the basic directions listed here working, but how do you do down and back and left? Is this a matter of changing the maths to cause a different vector direction?

Hey guys do you know how to move camera indepent of character?
when i am running my forward axis is always towards the camera view , i would want to hold left mouse button and look behind while my character is running its own way, exacly how in world of warcraft is.
After day i am tired of trying ;/
greetings Konrad

In your player controller class defaults, set Input Pitch/Yaw/Roll Scale to 0.