Question Family,Variable, Picking

Get help using Construct 2

Post » Wed Dec 26, 2012 10:42 pm

hello

I have a question about how family variables work.
I have family enemies, and I added States (Action) Direction, etc variables to family.
Problem is I cant make something affect separate sprite instance action was triggered with.

For example if one sprite is overlapping player and must be set to attack state, all sprites get variable set to attack state.
I tried for each didn't work.

how do I pick triggering instance and perform action on it?

Heres CapFile
https://www.dropbox.com/s/sfswiroklmerol5/Towerdefence.capx

please help and
thanks in advance!
hellwalker2012-12-26 23:26:20
B
24
S
7
G
3
Posts: 138
Reputation: 2,795

Post » Wed Dec 26, 2012 11:38 pm

Families and objects have separate picking. I mean if you have a condition that picks Enemies then you have to reference Enemies in your action.
You can have
[code]
+Enemies: Action = "Attack"
   -> Enemies: Set animation to "Attack"
[/code]
or
[code]
+EnMelee: Action = "Attack"
   -> EnMelee: Set animation to "Attack"
[/code]
but not Enemies in the condition and EnMelee in the action.

You've done it right in most places but not in events 6,7,8.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Wed Dec 26, 2012 11:51 pm

Thanks man!
I didn't know that. It works now ^_^
B
24
S
7
G
3
Posts: 138
Reputation: 2,795


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests