0
votes

I am using Cinemachine asset in my Unity project and is working fine without any lag. However, the places in my Scene which has a lot of ladders, are facing intense lag, making the game unplayable. Such a scene is shown below. enter image description here

Reasons that I can think of the lag is too many collisions happening or the cinemachine(may be). Two images below show the physics shape of the ladder sprite. enter image description here enter image description here

My camera is set-up inside an empty gameobject called "Cameras" as shown below. The state driven camera utilizes the player animator which is shown in the second screenshot. I am afraid that I can not provide a minimal reproducible example in this case. Could someone help me by pointing in the right direction to fix the lag? enter image description here enter image description here enter image description here

EDIT: Unity profile also suggests that Physics usage is consuming too much CPU with CinemachineBrain.AfterPhysics() and Physics2D.FindNewContacts being the major culprit: enter image description here

enter image description here

EDIT 2: The ladder is created using a tilemap component as shown below: enter image description here

1

1 Answers

1
votes

Can you try simplifying the collider boxes for the ladder to a single box collider shape?