com.unity.cinemachine icon indicating copy to clipboard operation
com.unity.cinemachine copied to clipboard

CMCL-1603: Added Padding option to CinemachineConfiner2D

Open glabute opened this issue 1 year ago • 0 comments

Purpose of this PR

CMCL-1603: https://discussions.unity.com/t/how-to-have-a-2d-cinemachine-track-go-off-in-multiple-directions/372767

When the camera ortho size is the same as the bounding shape, confiner2D allows a small amount of movement when it shouldn't. On first glance, it seems to be related to the step size used when baking. A small imprecision later gets magnified by the scaling.

The issue is that an arbitrary padding is added to the minimal confiner shape, to reduce the chance of creating a series of dots instead of a continuous shape. This PR introduces an option to control the size of this padding. The user should set it to the smallest value that produces acceptable results.

image

Testing status

  • [ ] Added an automated test
  • [x] Passed all automated tests
  • [x] Manually tested

Documentation status

  • [x] Updated CHANGELOG
  • [ ] Updated README (if applicable)
  • [x] Commented all public classes, properties, and methods
  • [x] Updated user documentation

Technical risk

Low. Larger padding values reproduce the old behaviour.

glabute avatar Jul 30 '24 13:07 glabute