I have two objects, a sprite and a target sprite for the first sprite to move towards. Sprite is in the family 'enemy' and the target is in the family 'enemytarget', and they are both in a container.
If I tell an enemy to look at enemytarget, all instances of sprite look at one target sprite. This happens even when using for each.
Why aren't the objects being picked correctly?
Develop games in your browser. Powerful, performant & highly capable.
Can you make a simple .cap demonstrating the problem?
There's a known issue with object parameters which might be relevant - the pairing doesn't work for families as you'd expect sometimes. If instead of using an object parameter you use a position and do Family.X, Family.Y, that might make it work.
I've emailed the .cap, and what you suggested worked! Thanks!
Thanks, yeah, as I suspected, it's a picking problem when you put a family in to an object parameter. Fortunately, there's a good workaround: use the 'to position' actions instead of the 'to object' actions. For example, Move to position enemynode.x, enemynode.y and Set angle toward enemynode.x, enemynode.y work fine. I'll see if I can get the object versions working as well.