You are conceptually doing the right thing, but you missed a couple of key ideas when working with families and functions.
Families
- When you use a family to pick instances in a condition block, you then need to use the family in the action block for the picking to work as you expect. If you directly use the object type that is part of the family in the action block, then the picking that took place in the condition block will be lost.
- If you want object types to share behaviours, effects or instance variables through a family, you have to add those to the family itself. This connects with the last point, because if the behaviour, effect or instance variable you want to use has not been added to the family, it won't be available to actions for the family.
construct.net/en/make-games/manuals/construct-3/project-primitives/objects/families
Functions
You can use the Copy Picked option so that the picked instances in the body of a function will be the same as the picked instances in the action block that called the function. If you don't use this option when the function executes, the picking is reset.
In your case this ties up with the first point because the picking done by the On Touched condition was done through a family.
construct.net/en/make-games/manuals/construct-3/project-primitives/events/functions
I updated your project so you can compare it against the old one to see what all of that means in practice!
drive.google.com/file/d/1KdU6BY1cOFQhfmTXYRcza5LlmWTvcGz1/view
I felt that making those changes was a little bit clunky, so maybe we will fix that in the future.