- Home /
Shaky Camera when multiple objects in motion,
I have 2 Objects: ObjA and ObjB. ObjA is the main object and ObjB is a secondary object. They both move based on data provided via a file. ObjA starts to move few seconds after the game is run and ObjB starts its journey after a minute. Both the objects move side by side. The camera is focused on ObjA position and rotation like:
void Update()
{
tranform.position = ObjA.transform.position + Distance // Distance is an offset;
transform.LookAt(ObjA.transform);
}
Both the objects have a separate script attached to them and they move in coroutines (I have to put some delay based on the timestamps given in the file).
THE ISSUE: Camera shakes! I tried to make the camera Update -> LateUpdate(), it fixes the ObjA movement, but ObjB is shaking. Conclusion: the object that is being followed by camera doesn't shake - the rest shake.
Extra info: I have tried my Objects 'movement' code in update too by tweaking that algo a little bit. But to no avail.
I have also tried Lerp and SmoothDamp but didn't help.
ITS BEEN DAYS! HELP PLEASE.
,
Your answer
Follow this Question
Related Questions
How to make a camera zoom in on a specific point 1 Answer
Resetting Camera with a key input 1 Answer
2D Cinemachine with Lookahead time respawn problem 4 Answers
Cinemachine components in one gameobject 0 Answers
How can you move a camera a set amount of units based on the player's x position in a 2d game? 1 Answer