Argh! Separate camera and player controls

Hi all, excuse the frustrations, I have been looking and playing with various solutions all day so think I should turn to the experts.

I am using the c++ side scroller template. This provides me with a player controller, which has a boom camera attached to follow the player. All I want to do is separate the player and camera.

  • control the camera with the mouse/VR (only pitch and yaw). The camera sits in one spot.
  • continue to control the player with the gamepad/keys.

From some lengthy time searching and reading, I went with the idea of a separate pawn for the camera. This is setup and works as intended when I assign it’s controls to Player0 - but that overrides my Character controls.

My problem is now in understanding what to do next clearly.I feel at this point I am really stabbing in the dark and should seek some guidance.

  • Is this a good way to separate them?
  • How can I allow both the Character and Pawn to continue to recieve inputs?
  • How can I now assign (c++) my newly created camera as the main camera in my game?
  • Do I do this in the gamemode class or the camera class?

Cheers

I seem to be finding I will need a second PlayerController, and assign that to my camera pawn, essentially having two players.

So I have set the pawn to be controlled by player 2, then set the camera as the main camera for player 1:

I do not think doing it this way will work as I am not ‘really’ player 2, I am always player 1.

I might try just adding in input to the class via blueprint and seeing if I can get around it. I would prefer to use c++ so hopefully if I succeed with blueprints I can convert that to the c++ equivalent…

Totally stuck!..so it seems the simple approach I was trying is not going to work, so the original question still stands…any help?

If no one can help within a day or 2, I will go back to leaving the camera in the original player class, and just position it in the scene where I want it. I really wanted them separated though…

Can you post code or Blueprint screenshot of your movement & look input handling?

I decided to put the controls back as they were, all under the 3D scroller character class. For the game I have I will only use single player anyway.
Ideally I would have liked to separate the ‘VR’ mouse component, but at the end of the day, at worst - I can extend a blueprint of my c++ class to handle all the selection done via VR. At best - do it all in code.