Tagging System

Get help using Construct 2

Post » Tue Apr 23, 2013 9:30 am

I'm looking for ways of being able to tag objects to save repeating code. Example, I want to tag all my physics objects as being "Physics" so that if I shoot a weapon and it hits an object tagged as "Physics" the object reacts.

Currently I'm typing events like "Bullet on collision with objectA" and repeating it for each object the bullet collides with.

I tried grouping objects as a family but onDestroy seemed to destroy every single instance of the objects I grouped.

Am I just being an idiot? Probably.
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Tue Apr 23, 2013 9:53 am

[QUOTE=CrudeMik]
I tried grouping objects as a family but onDestroy seemed to destroy every single instance of the objects I grouped.[/QUOTE]

Families would be one way to do this.

Your destroy event is probably like this: 'Destroy object', when it should be 'Destroy family'.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Tue Apr 23, 2013 10:11 am

Oh yeah you are right! Thanks
B
39
S
12
G
8
Posts: 580
Reputation: 7,108


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests