Hiya Mackey! Sleepy forum this weekend, eh? nod.
I think what is happening in your code… is a lot of repeated little-lerps… and that’s why she jitters.
I think… hmm… maybe think more like moveWithCollisions(), which uses ummm… small amounts of change toward the “follow direction”… and then YOU need to make it do continuous direction-to-target updating, and the looping/repeating.
This issue is a bit complicated for my simple brain. But moveWithCollision does NOT use a “target” worldCoord (as a param). It uses a direction and magnitude, I believe. I think… every moveWithCollisions() playground… has it INSIDE the renderLoop… https://www.babylonjs-playground.com/#16MDIB#1. It is a very fast “little stepper” and it is working with directions and magnitudes, and not with worldCoords. Any “target” work… is ONLY for updating the direction and maybe the magnitude OF that direction.
Even in a standard followCam… Babylon.js/followCamera.ts at master · BabylonJS/Babylon.js · GitHub (lines 142-166), you don’t see a lerp. You see more of a continuous chasing/pursuit… “live”.
Aren’t lerps actually pre-grown… calculated first, and THEN acted-upon… and thus not “live”? For your jitters, it is POSSIBLY because you are “playing-back” short little “pre-recorded position move-sequences”… one after another. At every little pause in your follow-animation… you are stopping to record (lerp-calc) a new little sequence of positions… and then start it playing. It’s actually not jumping… it’s pausing… repeatedly. (maybe)
Babylon.js/abstractMesh.ts at master · BabylonJS/Babylon.js · GitHub (line 1368… works with a thing called displacement… and no lerps seen).
I dunno if I know what I’m talking about… but perhaps something I have said… makes sense to you. I think repeated lerpings are causing the jerks, jumps, and jitters. Instead… stick your mover in the renderloop… and do little “displacements” towards the target… REAL OFTEN. The “real often” part… is what smoothes-out the follow-animation. The little jumps are too small and too fast for our eyes to notice.
Possibly, it might be wise to notice that followCams are a type of camera input… Babylon.js/src/Cameras/Inputs at master · BabylonJS/Babylon.js · GitHub. Universal cams… none. So, followCams might be updated by the followCam INPUT code. (followCam might “bind” to the renderLoop inside its followCameraInput code). This is why you don’t need to install a followCamera updater/stepper… into the renderLoop… to make it follow.
Therefore… you might need to add a followCam input to your universalCam.inputs, or code-up your own followingUniversalCameraInput interface (a custom camera input for FollowingUniversalCameras). Gruesome, eh? Or maybe simply update (step) your follower… in your scene renderLoop… and not need a custom camera input.
Lastly, I would check to make sure that there is no camera “behavior”… called “follow behavior”.