SceneInstancesCount(Object) not working in custom behaviors

Pretty straight forward, as the title says SceneInstancesCount(Object) in custom behavior events doesn’t work and will always return 0. I tested with “DoStepsPreEvents” and “DoStepsPostEvents” methods.


It doesn’t work even all instances are from the same object with the behavior (I wasn’t using multiple objects).

I don’t know to what extend it’s a bug or a missing feature, nor if it can be fixed. For context, I wanted to use the expression to check when it’s reading the last loop for objects that have the behavior. I should be able to find a workaround, tho it was the easiest way to do it.

I’m not sure why you want to use this expression, but the expected value would always be 1 or 0 anyway as there is only 1 instance of Object in a behavior function.

You should probably create a function with an object and behavior parameter.