All templates suggest using a camera attached to the character with a “spring arm”, and the camera always moves together with the character. But how to make the camera control separately from the “default character”? I mean camera control like in Fallout 1-2, BG 1-2, PST etc.
Create an actor that has a camera and move it around instead. The camera does not have to be attached to the character. Do note that you can have multiple cameras.
edit: or you could have the camera attached with a springarm as you mentioned, but keep the location & rotation absolute. So the cam is still part of the character blueprint but lives in world space rather then player’s relative space. This may make the communication between the player and the camera a bit easier if you’re just starting with UE4.
Thanks for the answer. I tried both ways. Please explain how to control the camera when it is not in the default pawn?
You make a player controller, make it have reference to player and reference to camera actor. Then you add input to the controller and with keys you want to move camera like left and right you move the camera and with clicks/wasd you move the actor for example. The controller doesn’t need to hold any logic, can just use it to activate MoveRight() in the player pawn through the reference. At least that’s how I have done it in some small prototypes. You could also make a key that switches between the pawns or flips a boolean with what you manage whether pressing A moves the camera left or the character left. Can do a lot of camera stuff pretty easily, hope I explained it well enough
This. For simplicity sake have the controller spawn the camera actor - the above-mentioned reference. You can *Set View Target with Blend *to start looking through the camera of this actor (in case there’s more than one camera available elsewhere).
Just tell me where to specify these reference if the controller should not to hold any logic?
**Vembumees **did not say that it should not. He said it does not need to. It’s a good idea to *process *input in the PC and then send the request to whoever needs it at that time.
This way, when you press W and send it to the player or the camera actor, different actions can be executed on their end.
Imagine a situation where you use the same WSAD to move a footsoldier, a tank or a plane. The PC detects A being pressed but the footsoldier shuffles to the left, the tank turns and the plane rolls.
The implementation of that request should be in the target actor - the target actor is usually a Pawn but it does not have to be. Perhaps you have a full screen 3d map of the area and you want to shift around with the same keys that move your character. Or perhaps you have an independent camera…
edit:
So like this, for example:
https://forums.unrealengine.com/core/image/gif;base64
The Player Controller on the left, Camera actor on the right. Do note this is just one of *many *ways of doing it:
vid with results: https://i.gyazo.com/ab8a7d1cc8c51ae6…ec97762330.mp4
I do not need an example using a template, because I do not understand it. If I had a programmer education, I would not ask these questions on this forum.
Well, let me clarify my question again.
We take an empty project and create two actors - a pawn with a camera and a character without a camera. In the pawn we write the commands for moving of the camera, and in the character we move to the point. I just want to understand how to specify the control of two objects in the player controller? Because initially I can control only one of them - the one that is specified in game mode as the default pawn.
It is in my example, precisely that. The player controller spawns an actor with the camera and controls it. This is the easiest way. Far from ideal, but it is the easiest.
In general, I have already solved the originall task, by the metod you specified earlier. I mean, leave the camera in the character’s pawn, but set to SpringArm the world coordinates.
Returning to my first question, I claim that you still have not answered it. The example you quoted is not correct, because the camera used in the player’s controller is not a camera in camera-pawn. Also, your example does not allow you to bring the camera closer to the character using the mouse wheel and a spring arm.
So, I spawn camera-pown, but all control in camera-pawn blueprint does not worked.
Therefore, I repeat my question: how to activate the control seted in the camera pawn?
What does it even mean? You specifically asked for a camera that is not associated with the Pawn. What if you have a party of 3 Pawns - you want all of them to send input to the same camera?
This is *precisely *what the example does. Pawn can move on their own, so can the camera.
You never mentioned this, did you?! This has been done a thousand times before, though - easy to find on YT. In short, use mouse wheel input to control the length of the springarm.
Why a pawn? I was just using an actor but sure, use a Pawn for this if you must, but it might become confusing a bit. You can absolutely have a camera pawn and a player pawn and possess them individually. A common thing to do, really.
I really truly do not understand where the confusion is coming from. Did you look at the attached video? Is this not what you’re looking for?
I can write the logic of controls the actors, but only one will work, that is specified in game mode as the default pawn. I ask how to make the engine see inputs, written in other actors blueprints?
Maybe, i should use cast finction, but it can not specify actor target, because it is not in that actor.
For example, i make 2 blueprints. First one - camera pawn blueprint with spring arm and logic to move camera by keyboard and mouse, and control the lenght of spring arm to move camera to character; and i make the thecond blueprint with character and control of them move. When i set in the game mod that the camera is a defoult pown then i can control camera in game, but can not control character. If i set in game mode, that the character is a defolt pown then i can control the character and can spawn the camera, but all inputs keybinding in camera blueprint dont work. How to turn on inputs control logic, writen in not defolt pawn?
P.S. Sorry for my english. Maybe we do not understand each other because of the difficulties of translation.
This is not recommended. You should handle input in one / two places at a time rather than grant actors a chance to process it. But if you must override it, you can, of course. Ensure the input is **not **consumed on the node you’re using:
And **enable **input on the actor - Auto Receive Input in the Class Defaults:
This solution did not help me, but I need to solve the task for two reasons.
- If you use the camera in a character, then camera does not pay attention to the landscape - see screen1.
](filedata/fetch?id=1777794&d=1592510446) - It is not possible to return a distant camera to the character by pressing a button - see screen2.
](filedata/fetch?id=1777795&d=1592510482)
That is why it is more correct to place the camera in another actor and control two actors at once - both the character and the camera.
Is it possible to solve thise tasks without two different actors?
You need to program that. Check the height of the terrain ahead of where you’re looking and adjust for that.
It is. You set the camera actor’s location to the player’s location. You can see the camera’s reference in my example here - called MyCamera.
Of course it is. The following is from my very first answer to you, the one you’ve just quoted:
…]
Did you look at the attached videoI attached? Is this not what you want?
Six years is a looong time between posts! Welcome back!
Looks like you have an invalid reference. Double check the way it gets Set
.
Hahahahaha!
Proving once again that there is nothing new under the sun.
In fact, this question about the camera has troubled me for a long time, and I know the essence is because I am still not familiar with UE. I’m still a novice.
I check the Set, not sure where goes wrong.
Here is the BP:Imgur: The magic of the Internet