How do I link two objects together?

Get help using Construct 2

Post » Sun Apr 12, 2015 3:55 pm

I think it's about time I actually learnt how to do this properly.

What I'm trying to do is have an object only affect one different object in the event editor, and not every single instance of that object.

Here's an example I made of this to show where I'm going wrong:

Image

I'm using the invisible object as the collision hitbox for the pink ice block, since when it's triggered it shakes before falling. And otherwise that shaking will shake the player as well, which I don't want. This works fine in itself. (Even if there is a better way of this, it doesn't matter - the main problem occurs all the time when I'm making things, and I'm still using the method below.)

The only problem - I'm having to make each block object and hitbox object seperately every time. I'm sure there is a better way to do this, but I just don't know it.

Image

Those 5 blocks are here in my events, the exact same thing happens for each, but I'm having to copy and paste over and over and replace the objects with the duplicates. Otherwise, all the 5 blocks trigger together.

How do I get each one to trigger separately without doing this?
B
3
Posts: 6
Reputation: 187

Post » Sun Apr 12, 2015 4:41 pm

You should put the collision box in a container with the ice blocks. This will spawn a collision box for each ice block automatically -- and vice versa -- and the associated pair will be picked together in events. I'd suggest reading the manual entry on containers.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,116

Post » Sun Apr 12, 2015 5:09 pm

linkman2004 wrote:You should put the collision box in a container with the ice blocks. This will spawn a collision box for each ice block automatically -- and vice versa -- and the associated pair will be picked together in events. I'd suggest reading the manual entry on containers.


Thanks, got everything working fine now.

That's actually the last thing I tried before I posted here, but I was put off since it was destroying both things at once after it started to fall. Turns out that was just me being lazy with the events.
B
3
Posts: 6
Reputation: 187


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot] and 28 guests