Cells not alligning with the inventory

I used the Sticker behavior for the Cells to follow the inventory but they dont allign with the inventory like in the editor.
(Im also using external layouts to create the inventory in the scene)
ShareX_fgH1fmLgbD

Events:

I would be very thankful if you could help!

It looks like possibly you have two inventory cell objects - one aligned correctly and another on top slightly offset… Is there anywhere in your code where it might be adding/creating another inventory cell object? Or, if using layers, perhaps you need to hide the layer the inventory is on in the Layers window.

I don’t now how work just looking the events, but…
In your video (in concret when you initiate the game) this are more left, and the window move a little in the right (this is important)

At the beginning of scene the Inventory move little right, because cam are in center of player right?
These little move, makes the stick inventorycell put wrong in inventory.

HOW TO MAKE GOOD STICK?
put the Stick event in event “TAB key is released”

why my answer need check?

its actually a part on the inventory png I left it so that I could see if the cells are positioned correct, sorry for not mentioning it in the discription

You verificate the little move of camera don’t altered the inventorycell?

it does but evenif I don’t resize the window it still sticks differntly

GDevelop_EU1KdDXG4D

ok. You put the Stick event in the first place (Just down the event “change the X position of the center…”) that makes the event stick apply always in Inventory (This can make 2 things: 1-Solve the problem, 2-Stick one, and other and other and make your game go slow and inventory are disaster)
If you tell me didn’t work, tomorrow I investigate your case ( if you still haven’t managed to solve it)

Ok thanks a lot, wait… it didn’t work, I’ll also try more things.

1 Like

Is the inventory like a popup window? If that the case, I’d suggest you put the inventory on another layer, and don’t move the camera on that layer. You then don’w have to fiddle round with centring the inventory, or worry about sticking the inventory slots.

I didn’t really understand what you mean. Should I try to move all the elements from the external layouts to the main scene on another layer?

Ok, today I make some experiments and that’s the result!

Tell my, this video helped you or no!!
P.d I like how is my Epic_Hero 7w7 :rofl:

Not quite. Create a new external layout, add a new layer (say called Inventory_layer) and place all the inventory objects on it. Remove the inventory objects from the scene of each external layout (don’t delete them from the list of objects - that will remove them from the entire project (depending on you r setup))

You can then show and hide Inventory_layer as you need it. The only extra you’ll need to do is only action the inventory clicks when the layer is visible. Just because it’s hidden doesn’t mean it doesn’t interact with mouse clicks.