How to make a camera that acts like a cam parented to a character, yet, is in its own blueprint?

Imagine the camera in the side scroller template. I deleted that parented camera, and made an actor blueprint and added a camera, compiled and saved, dragged it into the world and positioned it to achieve about the same look as the other camera. Went into the level BP and added a few things now that new camera is the default when I hit play.

What I want to do is for that camera to perfectly match the players movements, I suppose all but the X. And at the exact SAME speed as the player character. Is this possible? Thanks in advance!

Pick one:

  • attach camera actor → character actor
  • attach camera actor → character component
  • use a Child Actor Component → Set class to the Camera Actor (don’t drag one into the world) - the CAC will create an actor automagically.

camera to perfectly match the players movements, I suppose all but the X.

  • keep attachment as absolute and override YZ only

Produced this:

1 Like

If I understand what you want to do correctly:

I made such setup for top-down squad tactic game. It had multiple squad members, so standard camera did not work.

So i created player pawn with camera on camera arm (turend on lag and smoothing for it).
Then usual camera controls, like pitch zoom etc. done them all because specific gameplay and camera behavior were not yet needed. Then on i connected it on event tick and updated camera pawn location to squad teammate location. Everything worked perfectly.

And then i tried to optimize blueprint code and not spam that poor camera thing with location update, so i did update every 0.2 sec (that is god old delay from movies etc, works for most updates in games also, so worth checking if you need on event tick or not as often). That slower update with camera arm lag/smoothing works perfectly.

With this setup you can have much better control over camera, it is sidescroller so at some point you will probably need to implement some boundaries for camera (like level end etc). With separate camera from player character you will have less mess and edge situations.

And as i said, even with slow updates to camera location everything works fine.

Thanks for taking the time to answer this and making the pics and video, I really appreciate it. I’m assuming that you used the third method “CAC” in your video example. I started a new third person template to try your steps exactly.

I made a blueprint (actor), opened it, went to viewport, added a camera, move it to the scene root and got rid of the white dot that is there by default, compiled and saved and closed it.

Opened up the third person character BP, went to the viewport, added a “child actor component”, and set it to absolute location and rotation as you showed.

Actually, I may have set the wrong setting for absolute location, its the little arrow in the main transform.

I went ahead and deleted the follow camera of the player, and I see now what you mean about no need to drag it in the world, it generates itself in the world.

Unfortunately, it is not working for me…

It sort of is acting like there is no camera so camera view is like at center of the mesh if you know what I mean. Not sure what I did wrong. But again, assuming you used the CAC method of the two suggested for your video, do I need to do anything in the level BP to set view target?

I will try the attach methods later and see if I have any luck with those.

–Edit-- I had more than one pic to show but I was again hit with the error message posting this saying it is a “new” account and new users cannot post more than 1 attachment, not sure what that is about, this account is over a year old with well over 100-150 post and comments.

Hey thanks for taking the time to answer this, I’m starting to consider the benefits of having the camera by itself for more control.

I tried the other methods and can’t get them to work. But I was able to get something somewhat working using the original idea and putting this in the level BP.

For reasons I don’t understand, that clamp node is acting kind of like the speed the camera actor moves in. That along with that timer I’m using as an alternative to an event tick (I hear event tick is costly) to simulate an event tick. The problem is that it is either moving too fast or too slow for the player movements, while it is an interesting effect no doubt, its not what I want here, I want it to move exactlly same speed as the player. Maybe someone can offer me an explanation what is going on here and how to fix it, thanks.

I will try an upload a video later and show you what Its doing right now.

Here is the video https://vimeo.com/manage/videos/625979244

Don’t know if there are many options that do what tick event does and be less expensive at the same time.

This is incredibly expensive to achieve something that is basically free. And why are you are telling that timer to fire in 1/1,000 of a second?! :eyes:

@Everynone already gave you the best solution.

Ok thanks, I’m still trying to learn Ue4.

My logic was that high rate would be closest thing to event tick constantly updating. I think now I need to be able to take player movement input from the third person character and use that to fire this exec and not an event tick nor a timer. Was trying that, learned tonight about a bp macro library that can be called inside any bp. I thought that could be used to pipe that exec from player movement input to this bp but so far not working.

Event tick will tick once per frame unless told otherwise… but never 1 milisecond…

I suggest you study what @Everynone shared. You could experiment with other options after you understand what he did and why he did it that way.

Ok thank you, I’m trying to.

1 Like

Iin case it seemed that way, not my intention to be harsh. I understand UE has a very, very tough learning curve.

Just keep in mind that what you do and how you do it can and probably will come back to haunt you later in the project. So it’s important to understand why you decide to do things a certain way or not.

There seems to be many ways to do the exact same thing in UE4. I suppose all with strengths and weaknesses.

@ Everynone, can you expand more on the attach method(s) you mentioned, and can you look at what I currently posted and offer suggestions?

Yeah I’ve tried the child actor way described about 3 times and It doesn’t work. This camera problem has had me stumped about a week or so now.

There are no tricks here, no offsets, everything is at defaults; recreated this in the 3rd person template:

To me it seems like you do not have a springarm in the camera actor? I do not know how your world is set up. Do note that the camera stays at X: 0. Not sure what the desired effect is supposed to be.

Image4