Author Topic: Scroll list and drag objects problem [Solved]  (Read 3045 times)

Jeffom

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Scroll list and drag objects problem [Solved]
« on: April 05, 2013, 05:34:31 PM »
Hello i'm having an issue with a Drag'nDrop script (the one from the example) inside a scroll view

I have a script that works well in the editor but when i test it on a device (android 800x480 res), it gets buggy.

During the drag i'm reparenting the object so it won't be clippeid when i drag the object outside the scroll view, but when i try to return the object to its original position
the local position coordinates seems to get messed up, i'm keeping the initial vector3 position in the Start function and then i set it again in the drop function to make it go back into it's original position inside the scroll view. But when i set the localposition it's always off.
Can anyone help me on this?
« Last Edit: April 08, 2013, 08:13:25 AM by Jeffom »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scroll list and drag objects problem
« Reply #1 on: April 05, 2013, 11:02:33 PM »
You need to save and restore the transform.position, not localposition.

Jeffom

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Scroll list and drag objects problem
« Reply #2 on: April 08, 2013, 06:54:31 AM »
I've tried that already but it's still off

Jeffom

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Scroll list and drag objects problem
« Reply #3 on: April 08, 2013, 08:13:06 AM »
Finally figured it out, it was something dumb
i was saving the position at the start function but when i moved the scroll list the original position would change,
So i started saving the position on the OnPress function