Is overlapping at offset not working

0 favourites
  • 4 posts
From the Asset Store
Pathfinding AI
$2 USD
80% off
Units do not overlap each other and use different ways if there are several free ways.
  • I'm trying to create a custom collision checking system for our isometric game project. The idea was to check the target position before making any movement by the "Is overlapping at offset" event. If there's no overlapping happening at the target offset, then the movement can be made. However I don't quite understand that why is the following script doesn't work. I replaced the actions a bit for testing purposes to have it destroy the colliding object instead of stopping the movement. But no matter how I try it, the logic simply ignores the overlapping coordinates, the house won't get destroyed, I can move straight through it.

    Both objects have their collision enabled, polygon set up, are on the same layer. Any help would be appreciated.

  • That 'offset' is middle in your object.

    Check offset at

    Self.X - distance*sin(60)

    Self.Y - distance*cos(60)

    Where distance is anything you need.

    To see what you are dooing, you can move a small sprite at

    test_player.X - distance*sin(60)

    test_player.Y - distance*cos(60)

    I see that youre player is a circle, that offset will also be a circle.

    Dont forget to move it 'back' when a overlapping is dedected. Else it keeps overlapping. You have to make a sorta 'push out of solids' routine.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That 'offset' is middle in your object.

    Check offset at

    Self.X - distance*sin(60)

    Self.Y - distance*cos(60)

    Where distance is anything you need.

    To see what you are dooing, you can move a small sprite at

    test_player.X - distance*sin(60)

    test_player.Y - distance*cos(60)

    I see that youre player is a circle, that offset will also be a circle.

    Dont forget to move it 'back' when a overlapping is dedected. Else it keeps overlapping. You have to make a sorta 'push out of solids' routine.

    Thank you for the answer. I tried changing the expression to what you are suggested (I used different numbers for distance, 10; 70; etc..), but still not working.

    Edit: Well, not quite the answer to this problem, but I managed to get the collision system working using the custom movement behavior's push out solid (nearest) option.

  • I figured out an other solution, and it works just as I intended. I drop this here if anyone interested:

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