Hi, I'm a graphics designer (read: Unity n00b) trying to program my first mini game
-- a simple 2d drag'n'drop thing.
I'm trying to construct a snap-to behavior, so that when i drag an object (Obj1) across the screen and it enters the rect of Obj2, Obj1 will snap to Obj2's location.
So far I have set Obj2 up to shout out whenever Obj1 is dragged inside its collider and that works great. But I want Obj2 to send its transform (or x and y) to Obj1 -- so Obj1 knows where to "snap to".
I'm trying to use "Get transform" but it stores the result in an Object, not x and y values. How do I get x and y out of that object so that I can set Obj1's location? Or should I use another action instead?
Thanks,
/Bad