Author Topic: very strange UIDragObject raycasting interference  (Read 4675 times)

thePostFuturist

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
very strange UIDragObject raycasting interference
« on: October 26, 2013, 12:43:29 AM »
Very simple setup:

Cube (with collider and UIDragObjectScript)
Plane underneath (with collider)

Cube drags fine...as long as there's no other object with a collider behind it, then it just stops working.

Any ideas?

thePostFuturist

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: very strange UIDragObject raycasting interference
« Reply #1 on: October 29, 2013, 03:14:45 PM »
OK, I've re-created the scene from scratch, the problem is weird to say the least, and is mostly resolved.

The reason is say "mostly" is, in the game mode in attachment two, you will see the cube, and a plane underneath it. In attachment 1, you see where it is positioned on the y axis. The cube drags around, we have progress! However, not everywhere, as the top left corner it just gets "stuck". Nothing happens, the dragging seems be getting some interference from the plane below. The plane does not have any rotation applied to it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: very strange UIDragObject raycasting interference
« Reply #2 on: October 29, 2013, 04:36:56 PM »
Enable debugging on your camera, this will give you an idea of what the mouse is hovering over. And make sure to disable the collider of the object you're dragging.

thePostFuturist

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: very strange UIDragObject raycasting interference
« Reply #3 on: October 29, 2013, 07:46:08 PM »
If I disable the collider on the cube (the dragee), it is not detected.

The top left corner is being shown in the attachment, where with or without collider, the cube is not detected, only the plane.

Note it is being detected everywhere BUT that corner, but this is only specific to this scene, in most scenes it would simply not be detected.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: very strange UIDragObject raycasting interference
« Reply #4 on: October 30, 2013, 05:25:32 AM »
Sounds like you need to increase the raycast range on your UICamera.

thePostFuturist

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: very strange UIDragObject raycasting interference
« Reply #5 on: October 30, 2013, 09:16:37 AM »
That would make sense, except that it's set to -1 (setting it to a very large number doesn't resolve it either).

thePostFuturist

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: very strange UIDragObject raycasting interference
« Reply #6 on: October 30, 2013, 08:38:49 PM »
I'm certain this is a bug in NGUI 3.0.2:

I created two new Unity Projects from scratch, one importing NGUI 2.7, the other 3.0.2.
Once again, from scratch, I created two scenes that are more or less identical.

2.7 works without any hiccups, in 3.0.2 the aforementioned problem occurs.

I've uploaded both of these projects here:
[Link removed]
« Last Edit: November 01, 2013, 08:31:06 AM by ArenMook »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: very strange UIDragObject raycasting interference
« Reply #7 on: November 01, 2013, 08:31:25 AM »
Never post NGUI source code on a public forum. Use your head.