Test if something is collidING

0 favourites
  • 7 posts
From the Asset Store
Soldier Test
$9.99 USD
A Construct version 2 & 3 "Stand-alone" RPG game with "In-Game Module" (IGM) integration.
  • I feel somewhat silly not being able to find this, the closest thread I found was this; scirra.com/forum/invert-collision_topic46284.html

    Basically I have a character that paces back and forth. I need them to stop pacing when the player gets in their way. I only see On collision, is overlapping and is overlapping at offset options. But I need to test if the character is colliding with the player. It doesn't overlap though. What're my options?

  • I was sort of confused about this at first.

    Think of it like this:

    'On collision' is exactly the same condition as 'Is overlapping', with the exception that it will only trigger once.

    If anything is overlapping, it has collided. Think of a collision as the beginning of an overlap.

    Therefore, I would say that overlap is what you want (I'd actually look at 'overlap at offset').

  • I thought that might be the case, they should change the title of that event. However this still doesn't give the desired result, I tried character overlapping player and vise versa. All collision boxes for all animations is a 4 point square. To make it more noticeable I made the action destroy the player. So is C2's collision detection really bad, or am I doing something wrong?

    dl.dropbox.com/u/44188718/index.html

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • yeah, sqiddster is right. Is colliding would be the same as current Is overlapping, but they are only test conditions without any actions.

    If you want sprite to stop or bounce, or whatever you have to code it manually.

    So it's probably something wrong with your events.

  • I'm well aware of that, but my point is, as shown in the example, the collision seems quite off... Is there a solution to that.

  • I think the 8-direction engine is pushing you back before you have a change for testing collision. Either add an invisible detector sprite with a bigger collision area, or use 'overlapping at offset'.

  • Thank you all for your help, I had forgotten that the visual player is not actually what the player controls but an invisible controller which collision are based on. Whoops!

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