How do I pick the item at the top of an object stack

I am trying to make a card draw code for my game, but instead of only moving the card at the top of the deck, it moves all the cards. how would I make this move only the card I want?

At first glance looks like it miss a trigger once in the draw event…but i’m not totally sure if it gonna fix it

the draw_anim variable is used similar to a trigger once, allowing further customisation and timing

true,but i still believe the problem is in the draw event…probably in the wait before setting draw_anim to false,bcs during that time cards may keep getting shuffled

The index 0 is the bottom of the stack. The ā€œmoveā€ action is only useful if you want to move several cards while keeping their order.

Take a look at the 1st examples linked in the extension description:
https://wiki.gdevelop.io/gdevelop5/extensions/object-stack/

1 Like

sorry for the bad phrasing of my question, I don’t really care about the position of the object in its prior stack, I simply want to change the position of the object instance that I am transferring to another stack and only that object instance

to clarify the wording, the order in the stack doesn’t matter, I just need to change the x and y position of the object instance that is being transferred from one object stack to another

nevermind, I was wrong about the order of the card in the stack not being important. switched the ā€˜from’ and ā€˜to’ to be deck height-1 and it works, thanks for the help

What I meant is that when you only move 1 card, since there is only 1 picked instance you won’t loose the order of the picked cards. So, it’s easier to just use ā€œremoveā€ and ā€œaddā€.