Hi guys,
I have a camera script that follows my player smoothly using “transform.position = Vector3.Lerp…” all the time.
Now I put in the scene cannon gun that shoots my player realy fast upwards (only on y axes) and my camera is lazy to follow the player at this point. I have already tryed to increase follow speed or parent the camera to my player but the camera always jumps on the player - that is not what I want.
I want the camera to be parented smoothly to the moving object - to the player. Is it even possible? How should I solve this??
Or even better - to follow my player smoothly on X axes but to be instant on Y axes with smooth aim?
Now I have this (following on X is smooth but the camera jumps on Y axes when targets the player):
float xPos = Mathf.Lerp(transform.position.x, player.transform.position.x, smoothSpeed * Time.deltaTime);
transform.position = new Vector3(xPos, player.transform.position.y, -10);
Please help me…