The Lerp doesn't work very well for tiles (SOLVED)

Hello. How are you?
I want to report that I find that the lerp doesn’t work very well with tiles. As you will see in the video, the floor is made up of various mosaics and they move quite strangely.
https://drive.google.com/file/d/1e2mpxXzXBXWELl87CnDGOBr52d5bhrq1/view?usp=share_link

I’m not positive about your events because I can’t read the language but I think it’s because for the base layer you’re making a lerp between the camera and the player but then for the other layers you’re using the camera’s new location as part of the lerp. So, it’s going to be just slightly different. You would need to save the current camera position in variables first, so all of the cameras use the same reference point.

1 Like

Hello!! Sorry I forgot to change the language before uploading the image xD
Now I configured it in the same way as it appears in your image but the problem continues, could it be an error between Lerp and the tiles?

Did you replace the camera x and camera y expressions with the variable names like in my example. I see the set but I don’t see their use in the lerp.

This is what I believe is happening:
Say you have lerp(1,100,.05)
the base camera will move slightly to 5.95
The other lerps use the new camera location
So, it’s now lerp(5.95,100) which is 10.65…

Honestly, now that I think about it, if you’re making the other cameras follow the first camera exactly then the other cameras can skip the variables and the additional lerps and just use the base camera’s new x,y location. Unless, I’m not reading it correctly.

1 Like

Thank you so much!! Now it came out fine, I hadn’t copied it correctly.
It turned out much better, at the end of the video you can see how the ground shakes slightly, I don’t know if that can be fixed, because the sprites don’t shake like that.

https://drive.google.com/file/d/1F4Qkq91eaANXmUgqQXqywi-oMUfdjwia/view?usp=share_link

1 Like

It looks much better. It had a disconnected, sort of parallax look before. IDK about the shaking but then I’m watching it on my phone. So, maybe that’s why I can’t see anything.

1 Like