So, from my limited experience with UE4 it seems to me that the main input is always directed via playercontroller right ? So technically whatever responds to the input must be a player ? That works great for a lot of scenarios but in my case I have a top down camera that , unlike top-down demo, does not follow the player.Instead - camera control and player control are 2 separate things. The player is moved around by clicking on the ground and camera is moved indepenedntly with mouse and keys. . I got that to work by basically doing the following:
- Created a pawn that has springarm and camera and exposes public functions like Rotate and Move which accept appropriate parameters
- Created a custom player controller that basically serves dual purpose. If it captures mouseclicks or other player-specific input then it just does whatever it needs to do. But if it captures camera based input it forwards it to the public functions of the pawn set in 1. That moves / rotates the pawn and its’ attached camera.
- At the beginning of the game I grab player’s controller and set its view target to the pawn from 1.
And all that works fine.
Just wondering if there’s a more streamlined, “proper” way to do this, since it’s a fairly common scenario.
I did see something called SpecatorPawn but not sure if that’s what I need. Did some searching but mostly got results about how to set specator’s camera, etc, without understanding what a spectator really is ? Is the way to implement above via this spectator or is what I have OK as is ?