How to set Camera location in Blueprint

I have added a CameraActor in the scene and would like it to follow my character. In the character blueprint, I can’t find the CameraActor object directly, so I used:

While I can get its location, I don’t know how to set its location. I try to use the following but the camera position doesn’t change:

What am I missing ? Thanks

You can instead add a camera component to a character directly, but you may have your reasons to have it as a separate actor. Do you?

I can’t find the CameraActor object directly

It’s a matter of telling this actor which camera it is and where it is. It needs referencing.

You’re using relative location which does not make much sense and then feed it a constant vector which make the camera stand in place. Wouldn’t it be more logical to have the camera track the player, since that’s what you really want. In the camera actor:

The above assumes you have a possessed character.


Yet another solution is to attach the camera actor to the tracked character. Then there’s no need to track anything.

2 Likes

Thanks for your answer, I’m a newbie in Unreal and still having Unity reflexes.
How can I add the camera actor to the character, not having the character in the Outliner ?

The example I gave with fixed vector is just to see that the camera is not moving at all.

Thanks a lot !

In the character actor, add a Child Actor Component and set its child actor class to your camera actor:

This component will automagically spawn a new actor and maintain its lifecycle. There’d be no need to track anything since these two actors an now glued together with the CAC.

The character can access the camera like so:

And the camera actor can talk back to the Character than owns the CAC:


Admittedly, there’s more than one way to set up the communication.

2 Likes

Amazing, thanks a lot !

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.