(solved)How do I use overlapping at offset correctly?

0 favourites
  • 6 posts
  • It seems that what ever i do, it works only in the left and top sides of the sprite, but i need to have the offset area all around the object... :/

  • You can also use negative values for the offset check, maybe that way you can make it work for the other two sides. But without looking at the code it is hard to know what the problem is.

    [quote:npv7t5ly]Is overlapping another object

    Is overlapping at offset

    True if any instance is overlapping any instance of another object. The collision polygons are taken in to account if set, as well as the object's size and rotation. The 'offset' variant will test for an overlap at an offset from the first object. For example, testing for an overlap at an offset of (100, 0) will temporarily move the object to the right 100 pixels, test for the overlap, then move it back again.

  • this is my "code"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is there any reason you are using overlapping at offset, instead of the normal one or the in build collision detection?

    What that code is doing is internally moving Dexter origin position 30px to the right and down. Then checking if the two object polygons overlap, Dexter (moved) and ydinjate in its current position. That is why it fires up when the object comes from the top left.

  • Ok, i figured it out. Thans for rf900.

    This program is lagging for some good documentation. I would give few hours easily for some good video tutorials.

    edit: the reason why am i using offset is that i need to simulate "radiation" of that nuclear pollution sprite. So it kills you slowly from little away.

  • You should do a distance check then, much simpler. Use System's "Pick by comparison", select object "waste barrel", distance(Dexter.X, Dexter.Y, barrel.X, barrel.Y), comparison <= 30. If the picking operation select at least one barrel, it'll execute the actions.

    Moreover, instead of the wait 0.4 second, you should add a "every 0.4 second", I believe that will behave more like you intended.

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