GDevelop
GDevelop copied to clipboard
Add expression to get object group size
Description
When creating a random object in a group, it would be easier to get the group size to create an object from its name with: "Object" + toString(RandomInRange(1, Group.objectCount()))
Solution suggested
Add a property to the group or an expression to get it.
Alternatives considered
None found
I think something like this should not be exposed, because:
- I doubt it's useful: when users create random objects they will likely do something specific on them so it's better to pick a number and create each object explicitly.
- People will confuse it with
SceneInstancesCount(Object)
I think this could be useful for a lot of scenarios. I've had a situation in the past where I could have used it.
Maybe to avoid confusion you call it something like group.Members() or MemberCount().