Thank you in avdance for spending a couple of minutes looking at this thread.
I’m not sure I’m using the right methodology here so a direction would be great appreciated.
What I’m trying to do: 2 canvas in my scene. On the left nothing. On the right 3 tiles. I’d like to drag a sticker from the right to the left. But when I drag it I don’t want to take the current one, I’d like to create a copy of it, so I can have as many as I’d like on the left hand side.
I’ve looked at inventories tutorial and while they do most of the work I can only drag the item from on place to another, not instanciating it.
While i’ll love to get the code writen for me I would really appreciate what would your approach be instead?
From what I understand, you can just use Instantiate to create a clone of the right sticker and then drag that clone to the left. Instantiate, after all, works with all GameObjects, not just prefabs.
when you click on the item have the onClick instantiate a clone of that object & then drag it. You will need to check that there aren’t multiple items stacked in the one panel though or you might have issues with the number of items in game etc.(where the player clicks & doesn’t drag but then thinks it didn’t work so clicks & drags again.)
Thank you that makes sense and that helps me to look at the direction. So my initial tile could be anything really in this case, like a button, or an image. I would use prefabs though as I think I’d reuse them more as I go. Thanks!
Thanks for that, yes good point, I’ll make sure these instances are destroy if “un-used” I guess. Again thanks for your direction.