families, containers and object picking not working

For questions about using Classic.

Post » Thu Jan 01, 2009 3:52 pm

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?
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Thu Jan 01, 2009 6:34 pm

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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Thu Jan 01, 2009 9:00 pm

I've emailed the .cap, and what you suggested worked! Thanks! :D
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Thu Jan 01, 2009 9:01 pm

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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests