Hi!
I’m setting up a camera system for a 3rd person game, and I’m using the Mathf.SmoothDamp() fonction to move the Y-axis of the camera parent(so when the player jumps, the camera smoothly transitions toward them vertically). It all works great in the editor, but for some reason not in the build version : the camera parent DOES follow the vertical movements of the player, but WAY slower than intended. I’m fairly sure the problem comes from the 2 last lines here :
private void LateUpdate()
{
float deltaTime = Time.deltaTime;
float newPosition = Mathf.SmoothDamp(
transform.position.y,
target.position.y,
ref yVelocity,
smoothTime * deltaTime);
transform.position = new Vector3(
target.position.x,
newPosition,
target.position.z);
I tried replacing them with a simple transform.position = target.position
(thus assigning the camera’s position to the player’s position without smooth transition) and built the game : worked fine, both in the editor and the build.
yVelocity is set to 0.0f.
Build architecture is x86_64 (also tried as x86, no changes).
I have the feeling there is something simple that I’m missing, but I can’t see it. Anyone got an idea? Thank you very much for reading.