![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | lalel345 |
I have a grid container for an inventory and I want to limit its content to a specific number of children, how do I do it?
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | lalel345 |
I have a grid container for an inventory and I want to limit its content to a specific number of children, how do I do it?
![]() |
Reply From: | dustin |
This is a simple solution.
if $Container.get_children().size > maximum_children:
$Container.get_children()[-1].queue_free()