0 Favourites

How do I Detect collision with solid objects

  • Hi

    I'm using a solid object as a button to open a door in my game, button is solid and when the player collide with the button a door opens and an effect that I created would happen, however when the player collides with the button, the game detects multiple collisions with the button and creates multiple effects, but I only need one effect to be created when the player collides with the button. I made the button solid so the player can't go through it. Is there a solution to this issue?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • If only the effect is a problem you can add another condition to the event trigger once when true and it will only spawn once.

    But this can get complicated for example if you have 3 buttons and 3 doors in a level, you will need to keep instance variable for each button with different value so you will know what button is pressed.

  • If only the effect is a problem you can add another condition to the event trigger once when true and it will only spawn once.

    But this can get complicated for example if you have 3 buttons and 3 doors in a level, you will need to keep instance variable for each button with different value so you will know what button is pressed.

    collision is a trigger itself, trigger once doesn't work with it

  • Oh yeah I forgot about that, well you can limit it with a variable then. Add global variable lets say its called temp set it to 0 on start, and add extra condition on the event temp == 0, then as soon as the trigger fires in the first action set temp to 1, so its only triggered once.

  • Oh yeah I forgot about that, well you can limit it with a variable then. Add global variable lets say its called temp set it to 0 on start, and add extra condition on the event temp == 0, then as soon as the trigger fires in the first action set temp to 1, so its only triggered once.

    Yeah I had this in my but it was conflicting with something else in the game, however I fixed the issue, thanks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
99 10,136
karshinkoff's avatar
karshinkoff
Unread hot topic
167 14,489
DMT2005's avatar
DMT2005
Unread hot topic
37 4,506
JackieChan's avatar
JackieChan