- Home /
Changing array values based on drag and drop
Hi I'm making a game where you have to move numbers in different slots and to manage them i'm using an array, for example slot 1 is element 0, slot 2 is element 1 and so on and the value of the element is the number that is inside the slot
I have set up a drag and drop following code monkey's video and i can't find a way to change the values based on that. Any advice? (I am pretty new to unity so try to explain as easy as possible, thanks)
What is the problem exactly? Is it that the elements don't change when you drop them, the text stays the same or are you struggling with dragging and dropping?
Answer by logicandchaos · May 20, 2021 at 04:44 PM
The thing you are dragging and dropping should have a script with a int value, then when you drop it, you set the value of the array element to the value on the script of the object you dragged.
Your answer

Follow this Question
Related Questions
Is there a way to drag and drop a folder into an array? 1 Answer
How to detect that array items are triggered? 1 Answer
String Parsing 1 Answer
Array index is out of range 2 Answers
Checking all elements of an array? 1 Answer