Dragging frame overridden by UIListLayout

Hello, I’m creating an inventory system but I’m having trouble with clicking and dragging frames of the inventory. I want the player to be able to click and drag the frame but the frame isn’t able to move if it’s in the UIListLayout.

This is my current script and the explorer view:

image

(Script of when player clicks on a frame and continues to hold mouse1)

image

In my script I tried cloning the frame and have it get to the same position as the original slot (which is being turned invisible) but a different parent, in order for it to be dragged

If anyone can help it will be much appreciated! Thank you for your time.

2 Likes

You’d have to remove the ui list layout and set the positions yourself instead

2 Likes

Oh like script my own list layout?

1 Like

uhuh, you got that right!!!

2 Likes

Oh alright, hopefully that won’t suck to make too bad! Thank you lol

I’m not entirely sure about this, but what happens when you change the parts parent mid drag?

1 Like

If I change its parent it just goes back to its original position relative to the “Container” frame, which is a ways away from where it’s located in the list.

Ok, try creating a frame, as a layer between the list layout and the draggable object

List > Frame > Drag

1 Like

actually,
grab the absolute position before parenting it out and then figre out a way to use that

1 Like

Get the absolute position before parenting out the frame’s clone or the frame itself? Cause the original frame isn’t being parented anywhere else

I tried getting the absolute position before setting the clone’s parent but the same outcome occurs

Apologies, where exactly would I put that frame? Because the list layout and the frame to be dragged are parented to the same object

Nvm I decided I’ll be going about this inventory system a different way, thank you guys for the assistance!

You can also design it with a UiListLayout and then in a script copy the absolute position of the overridden frames, convert it to udim2. scale and then position it with said scale, and destroy the uilistlayout so you have the designed position in the real game and you can also manipulate it however you want

sorry for repeating in case

1 Like

I’ll tinker with it more before scrapping it, I thought up another way to go about inventory that not many games do and looks more fun (I’m extremely lazy and don’t wanna make anymore custom inventory functions) :weary: