> I don't understand..
> You want to pin objects that don't exist on start of layout?
> You can't perform actions on objects that don't exist..
>
Then, why works? , This event actions works for me:
On Start Layout
for each (Family) Sprites
(Family) NormalMaps | Pick nearest to ( Sprites.x , sprites.Y) -> Do (Family) NormalMaps Pin-To-Pin (Family) Sprites (Position&Angle)
I have various objects in the layout that have a container that includes another that is the NormalMap, and when the game runs, with the previous event, every object creates their own NormalMap and gets pinned, so it's already works!. I guess the container action is made before the event "on start layouts" started, but as i said it's already works. Maybe to be more correct i have to change to "On loader layout is complete", but as i said it already works.
-
So, for the objects that are already in the layout before the game runs they create another object that is the normal map and gets pinned. They are asteroids that move and rotate and as i said works, try it yourself if not believe me.
Also i already have working that when a specific/individual object is created get the normal map pinned, but i can't get it working for a family and that's my question.
I have that every X seconds an asteroid is created. This asteroid have a container that includes the NormalMap image. If i add this event works:
On ObjectX created -> Do ObjectX_NormalMap Pin-To-Pin ObjectX (Position&Angle)
So the idea is made that instead of add an event for every object created pinn to their normalMap i want use an event with family or similar to do the same like in the "on start layout" and save add events for every type of the objects created.
Your problem here is that the family is not in a container..
The objects in the family are..
When an object is created it automatically creates all other objects in the container..
If you reference the family in the event, it could be any instance of the family, if you reference the object, it will only be the one inside the container..
The reason it works in the start of layout is because you use pick nearest of the sprite-family and I guess the nearest is the right one..
When using a container, pick nearest shouldn't be nescessary, but this might work:
I would use the sprite-family on created, pick nearest enemy and pin, because it's possible that the sprite-family object doesn't exist yet on enemy-family created..