constraining many pairs
CoIin
Member Posts: 197
Suppose you had a lot of cups and saucers, and you wanted that when a saucer was moved, its cup stayed locked in its relative position, how would you do that? I can see that you could constrain one actor to another, but how to do that to the primitive, so that any number of saucers would be able to constrain just its partner cup.
Comments
Each would need a game attribute pair for sharing the constrains between the cup and saucer (lack of array/indexing). You could then manually place each cup and saucer and adjust the constrain reference for each to use the appropriate game attribute pair.
For a more automated version of the above, you could use a scene controller to loop and spawn X many saucers and cups every fraction of unit of time, using a game level attribute counter for an index assigning each one a unique ID. Then in the saucer, have a nested rule X-1 layers deep to constrain it to a similarily ID'ed cup using said game attribute pairs. But now you have a big rule structure impeding performance during runtime.
You could manually place all the cups and saucers and in the scene instance of those actors, wire them up to each other directly (i.e. inproper actor-to-actor communication or reference). This method would bypass the use of game attributes for the constrain but it introduces problems with the actors no longer being tied to their prototype. Among other things.
It would be neat to have each saucer spawn its own cup but you would still need to loop through the saucers to put them out there or manually place them and then still use either the game attribute constrains or the scene level actor instance wire up.
So no real easy way without overhead and/or manual intervention.