How do I stop collision when an object collide with an other

0 favourites
  • 9 posts
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • I have this problem since the begining. When my player is overlaping un object I don't know how to stop the collision.

    For example I'm making a teleport system with an Entrance "Teleport In" and an Exit "Teleport Out". And a reversed system for the wayback

    [quote:w0mrbl0o]So when my player is overlaping the object "Teleport In", its state become "teleporting" and its position move to the position of the "Teleport Out".

    It works nicely, but the problem is when the player arrives on the "Teleport Out" object (it's overlaping this object), so its position change instantly and it goes back to its origin position (the "Teleport In" object).

    I would like to do something simple.

    When the player goes to the new position, collisions are inactive until it goes out of the "Teleport Out" Object. And when it comes bak on it, it's teleporting normaly in the other way.

    Sorry for the long post and thanks for the help

  • Here is an old demo I made for another post:

    http://doptrix.com/C2/simpleTeleport.capx

    It's for C2, but you should be able to open it in C3.

  • Thanks Dop 2000.

    It's great, but I curently I don't know how to create and use fonction.

    I know it's a powerfull tool, but I'm a newbie ^^'

  • Thanks a lot Dop 2000.

    I have a problem with the collision. Could you help me?

    I made an enemy which move left to right with a sinus. When my player collides with it, I want he dies (the player). So I want to turn off the collision detection. But when I do it the player comes across the platforms.

    Do you know how to disable collision with only one object or object type?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have an idea, but I don't know if it's a trick or a good practice.

    I'll put a sprite in the enemy, using container.

    This sprite will be its collider.

    When the player collides with it, I destruct it.

    Good? Not Good?

  • I don't understand. When player collides with enemy, player should die, is this correct? Then why do you want to disable collision detection?

    Anyway, you can disable collisions for any object, use "Enemy-> Set collisions enabled/disabled" action.

  • Yes, I want he die, but I don't destruct it.

    So the enemy continues to collide with him. And when the enemy collides with the player, the player played animation moved and winks.

    When I disable collision like you said, my character (enemy or player) goes through the platform.

  • Ok, you can disable collisions and disable Platform behavior.

    Or you can add another condition to your "Enemy on collision with character" event, something like this:

    Enemy on collision with Character

    Character compare variable Health>0 -> Character set Health=0

    This way this event will only be triggered if the character is alive.

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