- Home /
Camera Smooth - Player moves little bit back when jump
Hello,
I'm facing a problem when I'm using smoothing on my camera.
When my character jumps, he seems to come back a little before performing the jump animation. I have already checked the animations and they all seem to be right, besides having tried various soft scripts. In addition to trying to change the method of update (Update, FixedUpdate & LateUpdate).
Everything seems to work that I leave the smoothing value down.
void FixedUpdate()
{
// if the is following option is activated.
if (isFollowing)
{
var velocityX = velocity.x * Time.deltaTime;
var velocityY = velocity.y * Time.deltaTime;
float posX = Mathf.SmoothDamp(transform.position.x, player.transform.position.x + XOffset, ref velocityX, smoothTimeX);
float posY = Mathf.SmoothDamp(transform.position.y, player.transform.position.y + YOffset, ref velocityY, smoothTimeY);
transform.position = new Vector3(posX, posY, transform.position.z);
}
// Set the camera bounds.
if (bounds)
{
transform.position = new Vector3(Mathf.Clamp(transform.position.x, minCamPos.x, maxCamPos.x),
Mathf.Clamp(transform.position.y, minCamPos.y, maxCamPos.y),
Mathf.Clamp(transform.position.z, minCamPos.z, maxCamPos.z));
}
}
Please see the video below:
What could be happening?
Any help is welcome!
Answer by adipatil3517 · Aug 22, 2017 at 05:33 AM
sorry friend i didnt understand your problem could you please elaborate it so that i can understand
Hey... See the video please... my player moves little bit back when jump when apply smooth on camera.
Hey, sorry for delay but i don't see any problem may be the thing is when you move camera it take players position and then when you switch position of player the camera first reach previous position then it again take new position to move. i think that satisfy your query
Your answer
Follow this Question
Related Questions
How to change "Smooth Follow" script value in another script 2 Answers
Camera smooth follow behaviour 0 Answers
Changing a variable on a different object 2 Answers
Scale game vertically only 0 Answers
Cinemachine camera shake on button press 0 Answers