PROJECT
I'm attempting to make a simple "open world" racer with a 3D camera pinned behind the Car object. The 3D Camera (hereafter, Cam) is attached to an Arm sprite object (a long, thin rectangle) at image point 1. The Arm's origin point is at the far right of the sprite and image point 1 is at the first left. The Cam is pinned to the Arm and the Arm is pinned to the Car
The idea is that as the Car moves along (using the Car behavior, naturally), the Cam will be dragged along. An event line will have the angle of the Arm set to a fraction of its current angle between itself and the Car's Car.MovingAngle via lerp.
EVENT-> ACTION: Set Arm.Angle to lerp( Self.Angle , Car.Car.MovingAngle , 0.03 )
IMAGE 1: The Car (black rectangle with the green triangle) connected to the Cam (blue image) via the Arm (red, dotted line). The red dot on the Arm is the origin point and the white dot on the blue Cam is image point 1.
IMAGE 2: The Arm rotates so that it is the same angle as the Car via lerp. The Cam is always facing the Car.
IMAGE 3: The Arm is limited to a range it can go regardless of how intense the Car turns.
Now, for the practical part, this works. As the Car turns and drifts, the Arm is "rotated" gradually and relative to the angle and closes the gap so that the angle of the Arm becomes (virtually) zero-sum to the Car.Angle.
PROBLEM
The issue I'm having is that if I maintain a constant turn/drift, the turning rate will overtake the Arm and it will look like the Car does a massive spinout. I attempted to use a clamp() expression...
clamp( Arm.Angle , Car.Car.MovingAngle - 45 , Car.Car.MovingAngle + 45 )
But for some reason, this results in a similar issue. The Arm will "lock" against the clamp() range limit but if the turning rate of the Car is still too much, it will "clip" as if breaking past the boundaries of the clamp() and spinout again.
GOAL
The ultimate goal I'm trying to accomplish is to get the Cam to "dynamically" and smoothly update its position while maintaining an overall behind-the-Car fixed area.
Any suggestions would be greatly appreciated. Thank you!