Im not finding anything on this, is there a specific API for families in c3 scripting ?
Families exist mainly to help handle picking in event sheets. I don't think they have any particular applicability to scripting.
Develop games in your browser. Powerful, performant & highly capable.
families mean you can make assumptions that certain behaviors, variables and effects are on that type. So they are very important for scripting and currently there is no way to know if an instance is part of a specific family.
This is one approach to determine if an instance is in a family:
const { MyFamily, MySprite, MyOtherSprite } = runtime.objects; MyFamily.getAllInstances().forEach(instance => { switch (instance.objectType) { case MySprite: // ... break; case MyOtherSprite: // ... break; } });
Sami424 Can you share your use case?