I am tyring to filter objects in a condition that I have created in a behaviour (for exemple nearby objects)
Inside my condition (in the extention manager), when I check the result, only the correct number of objects have been picked up. But when I check in the scene eventsheet all scene objects are picked up. The condition did not filter the object.
So it is possible and the chances are that there are issues with your events. If you would post them someone may be able to point you in the right direction.
Here, I when used in an event sheet, I would like to only pick the “Targets” which are close enough from “Origin” (In the real project, I obviously wish to do more things… But the point here is to show that specific picking issue)
Actually your function should work. I guess it is of the expressions you are using: in the function you display your target number with the PickedInstancesCount-expression, in the event you are using the SceneInstancesCount-expression which is not the same.
I believe functions are meant to be sort of self-contained. A work around and actually a longer lasting way would be to use an object boolean variable.
Set the object Boolean variable to false at the start of the function and then filter or pick certain ones and set their boolean value to true. Then back in the original area you can repick with a boolean is True condition.
Well, conditions do 2 things : send “false” when they are not met. And send “true” + pick objects up when they are met. That would be weird no to allow custom functions to do that…
Actually, the conditions “CanReachWithMaxWeight”, “CanReachWithMaxLength” and “CanReach” in the “Linked Objects Tools” do exactly the kind of object picking I am trying to achieve. So it is definitelly possible !
But these are written in JS. Maybe is not possible with the Extension Event Sheet. If so, I find it very odd… But, well, I’ll do without it.
EDIT : about the boolean + filtering. That would work, but it definitally is not what I’d wan’t to do in this specific case. The whole purpose of my extention is, for a large number of objects (let’s say 1000), to find which other is the closest. And I try to avoid avoid having each of my 1000 objects filtering 1000 objects.