#Drag and Drop

1 messages · Page 1 of 1 (latest)

cedar pulsar
#

are you using ui for drag and drop

#

ok i see

#

i recommend using ui images for the box so that you can use the IDropHandeler Functions

#

here is a video that uses ui images for drag and drop

#

later on you can add more functionality like making the slot know if a Pokémon is on it If yes then get its stats and update the party (if it is a party slot) etc.

vestal relic
#

Good evening, thank you very much for your help, but I'm not managing to switch between them, imagine inside the main grid there are slots and inside the slots there are pokemons, which in this case are images. Basically I just followed the video you sent me and it's working, but in my case it's different from the one in the video, he has empty slots and I don't, they all need to be full so as not to give an error with another script I have.

is there any way I can swap them in case slot1 has a pokemon and slot2 also, I drag the pokemon from slot1 to slot2 and in the hierarchy the pokemon from slot1 and slot2 swap.

Sorry if I'm not being very specific

#

This is the code that supposedly won't let you pair up the pokemons

#

This is the main one that does the drag and drop

cedar pulsar
#

soory for being late

#

went on vacation

#

so acording to me are saying that your "emty slots" are just ocupied by empty ogjects

#

in that case you can get more data on this method by following his inventory tutourial to see how he implements his systems

#

other vise you can mabye refactor your code to work with this system

#

maybe instead of checking of a empty slot you check for a slot with an empty object