Pivotal Camera Player Controller

Alright, so, following advice given by - I was able to get past my primary issues. He taught me a ton with casting and event handling. I am attempting to replicate the camera that is seen in Rocket League. Additionally, this project is merely for educational purposes and I do not intend on monetizing from others ideas. I am trying to learn camera tricks so that when I am ready to release a title of my own, the camera movements will be captivating.

So this animated gif shows what the “Rocket League Camera” does in gameplay:
(My apologies for the delay for those not in the US, these gif files are relatively large)


Currently, I have the Player Controller which handles the camera which is being referenced in my vehicle blueprint. Additionally, I am pulling ball actor’s world location to derive the appropriate rotation for the camera to keep it locked. The problem is that the camera location offset I have added keeps it locked in its position and it does not orbit the car in the same manner. I know why this doesn’t work but a clue on how to solve this is what I Really need. I’ve tried using spring arms with no luck.

This is what my camera currently does. You’ll notice it drive out of frame.

And this is an animation that I have drawn to illustrate (not precisely but you’ll understand what I mean) what I am trying to achieve. I need the camera to pivot around the car, keeping both the car and the ball within line of sight. I am not sure how to offset the camera location to account for this outer spherical orbit.

This is what the vehicle blueprint looks like:

Okay, we got it, but the camera is strangley “lagging”, like if the tick function would only be called every 0.1 / 0.2 seconds (which isn’t the case). Xonos will post the BP in a few minutes. Some ideas what could cause this?

Note: The camera “jitters” as its updating the rotation/position.
Updated blueprint:

PS: Sorry for the messy blueprint. This was thrown together quickly.

You just need to get the position of the camera (CamPos), the position of the Car (CarPos), the radius of the car (CarRadius) the position of the Ball (BallPos) and the rest should be simple.

New Camera Location = BallPos + (BallPos - CarPos) + (normalize(BallPos - CarPos) * CarRadius);
New Camera Forward Vector= normalize(CarPos - BallPos);
(use make Rotation from XVector then you can plug the result of that rotation into the transform node).

if something is reversed, then do BallPos-CarPos instead.

that is set up to always be looking at the ball through the car, and always be a certain amount past the car. In your image though you showed the camera staying still and that length varying. not sure what you actually wanted there.

Thank you for the very helpful tip RyanB. I appreciate it. I also found another solution (although it is probably not the best, performance-wise) before I read your post. I used VInterp To.

Here’s updated blueprint if anyone searching for this is curious: