As mentioned in the title above and illustrated in the .gif below, I’m having some issues with the default spring arm behavior. I’m trying to minimize the ‘jump cuts’ and erratic movement whenever the spring arm detects a collision, but I can’t come up with a solid solution.
What I’m mainly trying to achieve (and what you can see on the right side of the gif above) is for the camera to back out slowly after a collision, instead of jumping straight to the maximum “target arm length” of the spring arm. The most promising solution I could come up with is the following:
- Run a sphere trace with a radius that’s slightly larger than the probe size of the spring arm
- If true, set the “target arm length” to the current distance between camera and spring arm.
- If false, slowly interpolate back to the default arm length.
This works perfectly when standing still and rotating the camera, but it doesn’t work at all during movement. The problem comes in at step 2: Due to the spring arm’s camera lag, the distance between camera and spring arm does not equal the actual arm length and somehow produces the jittering illustrated in the gif below. I’ve tried calculating the new target arm length in a number of different ways, but couldn’t figure how to work around the jitter. If I disable the camera lag of the spring arm, everything is working as it should, but that’s just trading one problem for another.
I’ve tried several different approaches to reduce these kinds of camera jumps, but nothing really worked. If anyone can offer any kind of help with this - be it a solution for the jittering issue or a different approach altogether - I’d be super grateful!