Hello,
I am lost with the structure of my BP character pawn / game mode and I hope someone could shed some light into this.
What I want is a basic first person character camera which can be switched to a flying drone version camera with collisions. After moving freely in the drone mode, switching back to the first person would move back and activate the camera at the place where the character was last standing before switching to drone. The drone should move forward according to where the camera is looking at (basically like the editor camera, just with collisions).
I have tried putting 2 different cameras, toggling between them and moving the drone camera independently of the character. I thought that creating a collision capsule under the drone camera would make the collision work, however it does not seem to collide with the scene.
There is also a possibility of just making two completely different BP classes and switching between them (first-person pawn, drone-pawn, some other pawn…) in the level BP. More generally, if I want to have multiple cameras (pawns) each with a slightly different control, how should I approach it? Am I missing something? I am still new with the whole BP structure and I could not find any information that could help me.
Make the drone a separate pawn. Posses either the drone pawn or the character. Extend the drone from the Default Pawn - this way you’ll get the exact same controls as in the editor, collision and all.
And dropped next to the 1st person char in the level. You do not need to do it in the LB, you might as well implement it in the player controller - usually preferable, unless some special dependencies / interaction are required.
I have decided to do it through the possession of pawns - I was having problems to create a structure which would be easy to add more camera types / controls later.
Also, the default pawn with the basic editor movement uses a game camera. Is it possible to change the camera to a CineCamera with more settings? I am still using my own created drone camera, but sadly the collision on the pawn does not work.
The default Pawn does not actually have a camera - it does use a standard camera the Camera Manager provides instead, indeed. You can add a camera to the pawn:
I have successfully made the collision to work on my drone camera, thank you!
I had box collision component as root, then according to your suggestion I added the movement component (“FloatingPawnMovement”). I move the camera around using “AddInputVector” on the movement component, though for looking around (turning) I still add relative rotation to the root component. I also had to set the collision presets on the box to “BlockAll”.
I did not manage to add the Cine Camera to the default pawn. When adding the cine camera (with auto activation as well) it does not rotate or move with the pawn movement. I thought it would just inherit the behaviour of the standard camera from the camera manager
I am doing something slightly different (switching between first person and overlooking a card game), but close enough for this question.
The top blueprint almost works, but when I possess the “first person character” dropped into the level, even linked to “Get Player Controller” it’s frozen. It is also not the first person character I spawn in as, which I can control, but as there is no object in the outliner, I don’t know how to reference it in the blueprint.
My question is how do I control the first person character I drop into the level & can reference from the outliner, or alternatively how do I reference/possess the first person character spawned into the game that doesn’t have an object in the outliner I can reference? (Or possibly alternatively, why isn’t linking “Get Player Controller” to the possessed dropped-in first person character giving me controller control of it, although I have control over the spawned-in FP Character? Or how do I just start the level as the dropped-in FPC not a spawned-in version? Whatever fixes the problem.)
I am not sure if this could help you, but maybe you need to set your “first person character” in the Game mode to override whatever is spawned after you start the game.
Alternatively you can also check if there is a player start on your map as that could also cause some issues with controllers if not set correctly.
I am still confused myself with all the possibilities to spawn a character and multiple controllers
Just to follow up on this for future reference, in case other people have the same question. The best method I found for switching between mouse control mode and first person mode was described in this video. The part about getting first person control up and running is described at the end: UE4 Tutorial - Mouse Drag Objects - Manipulate, Grab Unreal Engine 4 Tutorial - YouTube
I set something up similar to what you explain but when possess the spectator pawn, the player character mesh loops last animation. Which is an issue when jumping and running on input press. Any ideas why this might be. Thank you