Hello everyone, I am making a 2d puzzle game and everything seems to work really well.
Than i faced a problem.
Problem:
Pretend there is a 2D sprite which is a triangle(doesn’t matter if its anything) and a drag and drop script attached to it. Now what i want to do is to create a UI (Inventory type of thingy) with the images of the 2D triangle. When i drag the image It becomes that 2d object and stays on the finger so that i can drag it anywhere.
Explanation:
At first i did it like (when you click the ui image it instantiate the object in the position of the finger but it doesn’t stay n the finger) which is a not what i want.
what i want is when you drag the image, the image itself disappear and a 2d object is instantiated and stays on your finger(not that you have to drag it again).
Hi there, have you checked official Unity UI demos? There is a drag and drop example;
I’m not sure if I got your question correctly, but It’s possible to just hide the image/transform you “pick” and then show some other image while dragging, then when you end drag, i.e. you “drop” the item, then hide the image you show while dragging, and drop the original picked image to slot.
Thank you all for your replies!
And guess what, i got it done thanks to the BoredMormon and Those official unity assets combined.
and its working the way i wanted.