0 Favourites

How do I overlap with collision off?

  • Greetings! ^_^

    So basically we have a cat chasing a mouse situation where the cat has collision off to pass solid objects while the mouse cant. Anyhow, upon the cat reaching the mouse, it should be game over.

    BUT since the collision is off on the cat, the trigger 'overlap mouse' does not work. Is there any other way?

    If X and Y of the cat = same as mouse = doesnt work either.

    Any solution for this?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • There are many ways of doing this and keeping the collision on to make it simple. But if you need it off then you can compare the distance. And when the distance between the objects is too short it is game over. Like this:

    Compare two values

    distance(mouse.X,mouse.Y,cat.X,cat.Y)

    is less than 5

    ---> game over

  • There are many ways of doing this and keeping the collision on to make it simple. But if you need it off then you can compare the distance. And when the distance between the objects is too short it is game over. Like this:

    Compare two values

    distance(mouse.X,mouse.Y,cat.X,cat.Y)

    is less than 5

    ---> game over

    Yes i need to keep the collision for several reasons. The object has bullet & 8 direction, which collision can not be ignored in this case.

    There is no distance between values, all i can pick is the distance traveled.

    'Compare two values'

    -Distance traveled is the only option found.

  • Use system --> compare two values

    You can also use system --> pick by comparison if you need to also pick an object at the same time

  • Use system --> compare two values

    Yes i did, there is only distance traveled.

  • It is not an action it is an event. So create a new event and select system-compare two values

  • It is not an action it is an event. So create a new event and select system-compare two values

    I know its an event. It doesnt work. There is more than 1 cat on screen, when reveresed (say cat distance to hero is less than 50) then all cats on screen die and not just the 1.

  • In that case you just have to use pick by comparison like I said in the post above.

    Here is a capx that shows how it is done:

  • In that case you just have to use pick by comparison like I said in the post above.

    Here is a capx that shows how it is done:

    Pick my comparison worked, thank you. ^_^

    In any case, the 'cat' has 8 direction and bullet state, which makes it not possible to remove the solid bumps without turning of collision, am i correct? It seems, it comes automatically inbuilt with the 8 direction/bullet behaviour.

  • Greaver Why are you using both the bullet and 8direction behaviour? What do you use to actually move the cats towards the mouse?

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