Best performant and smooth way to tween a camera through a path?

Hi,

I’m thinking of what the best way to create a smooth camera would be. I want it to be exactly just like Roblox’s default camera but instead it tweens to the latest position that the camera is set to be at. It would also be tracking an object, the player’s HumanoidRootPart.

The issue is that when I tween to the latest position it doesn’t take the path that the camera would normally take while facing the same direction at all times.

A solution that I thought of was to use a circular orbit (when tracking an object) to create multiple nodes (basically points that would have the same offset position and direction as if it was tracking an object) that I can smoothly tween to and I can always reconstruct a new path to fit the latest movement the player has taken. Each node would be created when the camera moves around and the camera will make sure to take the exact same route instead of going the short way which would not be the same distance between the tracked object (player’s HRP) and the camera point. The more nodes I add, the smoother the circular transition.

My question though, is this likely the best method? Is there any performance issues I should be taking into consideration? If anyone else has any better ideas I would love to hear them!


For people who work better with visuals:

Result with simple tweening: (no nodes, only tweening from point 1 to point 2)
image

Desired result:
image

Thanks again,
- Evercyan.

1 Like