Camera - Follow movement !

Hi there.

I think it have a name, but I can’t find it. What I’m trying to do actually is to… Slightly slide a camera in the same way than my character is moving.

A little video for a better comprehension : https://www.youtube.com/watch?v=2ZCSppddzig

It’s really light, but you can see the camera get ahead of the player. If he goes to the left, the camera move slightly in that way. And when he stops, the camera take her initial place. It looks like a bit moe dynamic than other camera but it can be pretty confusing if not well done. (Too fast etc…)

I think it’s not THAT difficult actually but I can’t figure how to make this work, since the camera must be locked on the player and won’t turn around (Like an isometric one, you don’t have the control on the camera, only on your character)

And I apologize for all my mistakes. You know. I’m French… Cough

Have a nice day.

Ps : If this kind of trick have an apointment, thanks to say it to me. For making it easier to understand…

That is quite easy:

  • add camera arm between character and camera (you should have it alread as it is standard setup)
  • enable camera lag, else you may get some nasty stuttering.
    Now for blueprint:

on event tick, get your controlled pawn get its physical velocity
Normalize it (to get just direction), multiply by [1,1,0] so you get only x-y plane direction.
Then multiply it by how much offset you want.

then set camera arm RELATIVE location to that calculated vector value.

Use the “RInterpTo” node connected to a movement input event to adjust the angle of the camera slightly in the direction the player is moving.

The logic would be:
1.Player presses “Up” input.
2. Use “RInterpTo” to rotate the camera slightly upwards (e.x. +5 deg of rotation on the Y axis).
3. Player releases “Up” input.
4. Reset camera rotation.

Another option would be to use a “Timeline” for maximum control of how quickly and smoothly the camera rotates. Bonus: it has a built in reverse function!

Wow, thanks for these quick answers ! You guys are so helpfull. Even if I’m still a complete beginner, I have to figure how to do it properly.

But still, many thanks to you,