This may be hard to explain.
Im making a card game and i have the basics set up so far but i have an Enum set up to define card types.
enum Slots (Monster, Magic, Equip, blah blah). I was wondering how would I make the code to specify 1 card to be allowed to be dragged and dropped on top of another card else be put back where you got it from. So far all I have in concept thought is
RayCast (something something) {
If Draggable.Slot.EQUIP (is ontop of) Draggable.Slot.Monster {
do whatever the cards are supposed to do.
}
Else parentToReturnTo {
(I forgot what I had for the parent to return to but I hope you get the gist);
}
}
I need help filling in the blanks and i can post both of my scrips for better context of what im thinking of doing if you want but i don’t have a clear way of executing it and google isnt helping me personally. i got most of my code from a good programmer youtuber and i used what he showed in his tutorial and ran with it and i hit a pretty big mental snag here.
I realise that i may be able to use the line
PlaceHolder[] zones = GameObject.FindObjectOfType();
and then search for all gameobject of the Slot.Monster for Slot.Equip to be dropped on top of…right?
or
EventSystem.current.RaycastAll( eventData )
this one is more specific to what is under the mouse so id think this one would work better for what im trying to do.