Author Topic: NGUI 3.6.1 Bug: Drag Scroll View weird behaviour when switching to 2D UI  (Read 4659 times)

hexaust

  • Newbie
  • *
  • Thank You
  • -Given: 14
  • -Receive: 1
  • Posts: 35
    • View Profile
There is something weird happening when using the new 2D UI event type for the camera and the NGUI > Extras > Switch to 2D Colliders function. This can be reproduced with the following steps:
  • Open from Examples > Example 7 - Scroll View (Panel)
  • Change Event Type to 2D UI

  • Use Switch to 2D Colliders function


Notice that when starting the drag the scroll view gets all "jumpy". After switching back to 3D UI and 3D Box Colliders everything works fine.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
I see no issues on my end, but I am working with a slightly newer version. I had to make some changes to how collider presence gets recognized since certain NGUI functionality was using object.collider everywhere, which obviously doesn't work if it's not a 3D collider.

hexaust

  • Newbie
  • *
  • Thank You
  • -Given: 14
  • -Receive: 1
  • Posts: 35
    • View Profile
This is the behaviour that I am talking about:

NORMAL


BUGGY



How can this be fixed? Any quick solutions?

mishaps

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 65
    • View Profile
I too am experiencing this issue. Everytime I drag a scrollveiw it initially jumps back to the x-pos it started at. Creates a jarring affect for the user and I need a fix before I can publish.

EDIT: I am also now having trouble with UISlider. The thumb is stuck in place - dragging it no longer works. I can tap different places on the slider to make the thumb jump there but cannot drag the thumb itself.
I have since reverted to a backup before I switched everything to 2D-colliders and both of these bugs are no longer there. Unity 4.5.0 and NGUI 3.6.1c. Hope this helps.
« Last Edit: May 29, 2014, 05:33:04 AM by mishaps »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
I see what you mean. I'll look into what's causing this.

Edit: Easy fix. Global replace UICamera.lastHit.point with UICamera.lastWorldPosition.
« Last Edit: May 29, 2014, 08:05:21 AM by ArenMook »

wildmandnd

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
NGUI 3.6.5
Still have the same issue. ScrollView + DragScrollView = random jumps when start dragging. Here is the video: http://take.ms/xAu1d

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Are you using 2D colliders there? Did you try to reproduce it in the NGUI's scroll view example?

SpiritOpportunity

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
I'm getting the same problem.

I changed my Scroll View from 3D to 2D, and it jumps now.
It works fine if I turn it back into 3D.

Using Unity 4.5.1 , using NGUI 3.6.1

SpiritOpportunity

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Edit: Easy fix. Global replace UICamera.lastHit.point with UICamera.lastWorldPosition.

Problem solved !

UIScrollView - line 701
mLastPos = UICamera.lastHit.point; -> mLastPos = UICamera.lastWorldPosition;

by doing this,  the jump problem is fixed.
Well, but I fixed it and tested it a moment ago so.. there could be some problems
but no problem atm.