How do I link two objects together?

0 favourites
  • 3 posts
From the Asset Store
Footsteps SFX Two contains 450 sounds of steps and jumps on different surfaces.
  • 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:

    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.

    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?

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)