Can't Get A Simple Button to work right.

Hello again. I was wondering if anyone could tell me what I’m doing wrong on this one. I have a simple purple square as a button that I want to be able to step on to open and close the nearby door. However, it will not work. I’m thinking that it may be due to multiple collisions hitting the box trigger on the button, causing the door to close instantly and I never see it move, because my print command shows two hits when I step on it. I’m not sure what to try though to fix it. How do I make it so that when my player overlaps the trigger, it only activates once? The same door works perfectly fine with a line trace and cast command and I have no problem opening and closing it.

Here’s the BP for the button that is supposed to activate the command to open the door when you walk on it.

And here is the BP for the door itself.

Like I said, when my player hits the door with a line trace and I follow it up with the Open/Close event it works fine. But for some reason the overlap event on the button command is triggering twice, which is why I think the door doesn’t actually look like it opens and closes because it’s doing it instantly.

Will using a ‘do once’ node help here? Stick it just before calling that open/close function (just after the cast). To reset the button you could either stick a small delay at the end of that execution chain which loops back to the reset node of DoOnce, or just have your “on end overlap” node (which i assume happens when the player steps off the button?) plug into the reset.

Create a Print String node after “OnComponentBeginOverlapp” and plugin the “Other Comp” output, to see what happens.
Your Character has 2 Components that overlapp, the capsule and the mesh.

Ok, one problem solved,. Thanks for your help! Now onto another regarding the same thing. :slight_smile: It’s weird. The OnComponentBeginOverlap(ButtonTrigger) event for opening and closing the door was reading one of the character’s arms and the body. I reordered the tree that make up the parts for the player character and made it so all of the parts are properly placed within the main “Body” static mesh. So in the components list, there’s the Capsule Component, then inside of that is the ArrowComponent, Mesh, Body, SpringArm and Firesound. I tested again and it only fires once when he walks on the button now. That works perfectly. It shows one fire of Player_C_1.CollisionCylinder when stepping into the box collision on the button.

The other thing that’s weird now, is that I made another character, (clone of the same simple testing design, but purple if you must know) and I have a collision sphere on it that stretches out a little ways past its body. I wanted to make it so that when the player character steps into the bounds of that sphere collider, it registers once that the player is within its bounds. The thing is though, is that I’m using the exact same OnComponentBeginOverlap(BoundryOfSafety) event, casting it to the player just like the box trigger from the other blueprint, but it’s detecting every part of the body on the player instead of once like the other trigger. What am I doing wrong on this one? I would think it would work exactly the same way, but it doesn’t.

Here’s the result of the player walking into the other character’s boundry.

Here’s the event for the collision I’m referring to this time.

I appreciate the help. Thanks again for taking the time!

Well your problem is collision depending, nothing we can see right now.
When your Character has the same collision it might be your BoundsOfSafety has a different collision than your box trigger.
Its hard to help on collision because its easier when you just add Print nodes (like you did) and test it yourself and change the collision. (it is also faster)
AND we dont know what collision you need for your actual gameplay.

But feel free to ask if you need further help.

There are so many collision options that I’m still figuring out I’m not sure what to set it to. As far as the collision setting in the triggers, the box for the button and the Boundry for the purple character are both set to OverlapAllDynamic. The thing I’m trying to do is get a single hit in the purple character’s BoundryOfSafety when the Player passes into it, so then I will engage another function that makes the purple character run away from the player until they are far enough away to be safe. I tried also changing the two GetWorldLocation functions into GetActorLocations for the player cast and the purple character, but no difference in results.