Hi, hope you are all well.
I was hoping it will be possible to have a function in this beautiful extension[Smooth Camera] to be able to move camera position to a target only on one axis. That is, move camera X or Y only unlike say in tween camera position which requires both X and Y postions of Camera to be input.
The need came about with me making a semi custom (spaghetti events system )where I take grid points to create camera grid zones.
If player is in a grid zone. I can either allow smooth camera to follow X/Y else I use grid points to move camera PosY/X (hopefully) independently.
Initially I tried using lerp but its not frame independent. Then I tried with the [Smooth Cam Extension] to move Camera in Camera follow grid zones and use “tween Camera Position” to independently move Camera PosX/Y in Camera follow free grid Zones.
Yet, the above method when tweening causes a weird lag in smooth camera movement … because when tweening I cant move camera to only one target axis thus if I move camera to x there will be a catchUp lag on Y and if I move it on Y same is present on X (where it is mostly noticeable.)
I tried editing through the extension. But my unfortunately by brains screams and scrams away calling for mummy. Apparently I know nothing with maths and Programming .
You said you tried lerp but its not frame independent
But did you try lerp with interpolation being TimeDelta()?
Here is how to use lerp to make smooth camera
Instead of putting there static value you could put 1/TimeDelta()
or 5/TimeDelta()
Actually idk proper value you would need to find it yourself
Maybe it should be (1/TimeDelta())/SOME VALUE HERE
BUT
I am not using smooth camera
But like does it not have what you are asking for?
Well not exactly. I didnt even know you could do it this way
Instead I just multiplied the smoothing value with TimeDelta.
Like; * camera.X() = lerp(camera.X(), player.X(), 0.05*TimeDelta()) and it was just so weird my brain forciblly forgot how it went.
But I will try to give this a go.
If I get you right. It should be like camera.X() = lerp(camera.X(), player.X(), 0.05* ((some value)/TimeDelta()).
Yes it partly does, but what it was currently designed to do is follow Player.X/Y if activated or not … and i do use that … what im trying to mix in is the ability to smoothly move camera not to player … but to a targeted positionX/Y using events kinda like tweening camera pos … except instead of tween CamX, CamY, in x (seconds) im hoping for something like tween CamX(or Y) only, in X seconds.
As always thanks for time guys.
I’ve managed to do it by using automatic camera with the smooth camera extension. Then locking it (FollowX or Y) and using lerp multiplied by delta to manually move camera to desired targets.
Thanks