Skip to content

Why is my list scrolling super fast after scene change. #30

Answered by LanKuDot
lavizp asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, the list stores the referencing camera of the canvas in the initialization.
And the list uses it to calculate the local position by calling RectTransformUtility.ScreenPointToLocalPointInRectangle(), which the null reference of the camera parameter is acceptable. That's why there has no error.
But it will treat the canvas that it is in the screen space - overlay mode.
Therefore, you also have to reassign the camera into the list.

Try this:

  1. At the line 47 in the ListPositionCtrl.cs, remove readonly keyword from the _canvasRefCamera.
  2. Add a new function to the ListPositionCtrl.cs:
public void SetCanvasRefCamera(Camera camera)
{
    _canvasRefCamera = camera;
}
  1. Add a new function to the C…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lavizp
Comment options

Answer selected by lavizp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants