Why wont my platformer button work?

This is my code,

when the box touches the button hitbox, the door moves, but once the box isnt touching it anymore, the door doesnt move back.
i checked the debugger and the active boolean isnt getting set to false, even tho the box isnt touching the box hitbox. but when i manually set it to false thru the debugger, it moves back.

Do you have multiple instances of any of the objects? An inverted collision condition doesn’t alway behave as expected when there are multiple instances.

1 Like

i have 3 instances of the boxes, any way to fix this, should i just duplicate and make multiple box objects?

With inverted collisions, sometimes you can fix it by reversing the object order. Instead of A in collision with B. Try B is in collision with A.

Normally, the object order doesn’t matter but inverted collisions are different.

Other times, you can use a NOT condition with a non-inverted collision condition inside it. This will likely fix it.

The issue with an inverted collision is it counts the objects not in collision. So, say you have 3 instances and 1 is in collision then there would be 2 objects not in collision. So, it might not reset or clear the trigger once.

Try those fixes. I’m going to be unavailable after this. I can check back letter today unless this fixes it or someone else helps you.

1 Like

thank you so much, it worked!

You’re welcome. Which solution worked?

1 Like

i only tried the not solution, because i also have multiple button hitboxes

hi, what should i do if i want to add another object that can activate the button, i tried this


but the issue came back. i tried separating them into different not conditions, but that also didnt work

IDK about the last event. It might be easier to create an object group for the different box objects. You could then just use 1 collision and 1 NOT collision using the group name.

IDK about 2 sub-events inside a NOT.

Your current events could be changed to

If one of the following
… NOT
… … collision
… NOT
… … collision

Or use a group for box and iceBox

NOT
… Collision groupName with buttonHitbox

1 Like

this worked! thank you!

1 Like