Download

Alts to overlaps.

It seems no one has a good solution for overlapping issues I am having so I am going to ask a different question what is a good alternative for checking is overlapping?

I was thinking draw trace would work. What do you think? I heard of other methods because other people are having issues with is overlapping and begin overlap but I have totally forgotten them.

For those who do not know. I have it set up where when you have a key, and are overlapping a padlock, when you press {x} key it opens the lock and it plays this animation, turns on physics and the lock falls to the ground (then of course over a bit of time destroys self). I have this collision box on my character and on the lock so it will easily overlap. The boolean I hooked up to check is overlapping shows true and false almost every frame, even though they are perfectly overlapping, begin overlap does not work how I want it to. I once had it working but then when I made a duplicate of the door to use somewhere else it broke again, and nothing I did fixed it.

So yeah what are good alternatives to is overlapping or what is a good way to set this up to be bloody reliable?

Common ways to do this are 1.Line-Traces, 2. Collision-Volume Overlaps, 3. Widget-Interaction-Component (WIC)… However your conflicting true/false results don’t make much sense, so you may have other things going on. Perhaps 2 pawns are spawned in the scene somehow? Anyway understanding object-collision & trace-channels wrt volumes is key, and without seeing all the settings, your pawn and the level, there’s no way to tell for sure…

So here’s a suggestion. Try and work from existing templates and build off working code. Having something that works is just safer. For example, there are 2 free projects in the Community-Tools forums section called ‘elevator’ + ‘keypad’. Both use fixed line traces to interact with objects in the world, and both will give you the code you need to make your lock system work…

I cannot find the elevator + keypad projects so far.

Here is the blueprint that originally worked (before I duplicated the door and tried to use it somewhere else). There is the True False bit. That box behind me currently was in front of me and I was testing the component overlap as in the box behind me overlapping the locks box and it also does the same thing. I just moved it out of the way just to see something. The third image shows where the box was originally which should have registered an overlap. Begin overlap and is overlap have the same results true false etc. Albeit I need is for a constant source.

There’s not enough there to reliably debug dude… For starters how is the Print-String custom-event being called, from where and when etc??? Also, using an overlap node that returns a Bool is risky. Why? Because there’s no way to reliably debug what it is doing. What are the assumptions behind it etc… For example how much overlap must occur, plus how does the order of the parameters supplied affect the outcome (if at all)?! Instead its better to opt for one of the Get-Overlapping-Actors nodes, that return a list of overlapping actors instead. Either that, or use the On-Component-Begin-Overlap / Actor-Begin-Overlap events inside the Character Blueprint. Or else create a dedicated Blueprint for the lock system. Add a single large collision volume, large enough for the player to just walk into and activate, using just the Third-Person-Character built-in capsule collision. Then drag that Blueprint into the level and center it over the door, so it can be activated from both sides etc.

But for now, going back to the Print-String custom event, the one that takes a sample of the Overlapping Bool. It samples the Bool at a different point in time from when the F key is pressed. Why? Its better to log everything at the same time. Otherwise, the risk is, the scope is different (i.e. you get 2 different but still valid results). Next, you set an Is-Overlapping var. But instead of explicitly setting it true / false using the node tickbox, you negate or toggle the value after the Branch. That’s going to work most of the time in Blueprints I bet. But its risky if there is ever a fringe case where the value has changed somehow in the meantime.

BTW:
Here’s the elevator BP to try. But if you want to progress you should try and fix the code above first. Then afterwards take apart the elevator sample and write a solution to your lock system using a line trace solution as well… If you do that, it will help your confidence, and you’ll progress much faster… Good luck!

I have is overlapping as in the box on the character, and the box on the door not sure what you mean you seem to be suggesting a lot of what I have tried. Print string is being called using a custom event being powered by event tick asking is overlapping component. In the screenshot though it shows overlapping player because I was trying the player in that one since I was told that would be a better option the cube overlapping does not register either as I stated they both register the same when you set it up be it the cube overlapping the other cube or the cube overlapping the player. With the boolean I just need it to register if I am overlapping. It then allows a signal to go through to the next branch which checks and sees if I have a key if so then it allows power through that branch if both of them are true. I could use an and, or a gate. However, I think I used either at one point and it did not work either. Not sure why the not is there for but someone suggested to put that there. It actually helped at one point. I have been trying to fix the code that is the whole point of trying to find a stable overlap since neither the player overlapping or the cube overlapping reacts as a straight signal.

Side note without a strong signal as in overlapping registering true the entire time the key will not unlock.The door, on the other hand, is fine with opening and such they lock does work so well and I only want it to be reached from one side of the door.

Here is my blueprint for what the lock does. Basically, register that I am overlapping if I am, allow me to use the key if I have a key then play animation subtract key, then bring up the overlapping boxes for the door so I can open the door, different box registers different rotation animations to play. I could change the order but that would make no difference in me registering an overlap.

I feel like this should work in all honesty. However, as you can see this only registers false. The key when I get it registers true false as the above as well. However, at source it registers true fine though and even further upstream it registers fine it however doesn’t at that print string. Not sure what is even happening at this point.

Interesting my boolean to register a key even registers true false that way when I have it.

Show the part where you call ‘Print-String → Is-Overlapping-Actor’…

Here you go, here is some really stupid stuff. I cannot even try to figure out why when you disconnect the node and reconnect it, it works for one turn even if I had an event begin it makes no sense.

https://youtu.be/VJkBRUpIXB8

Ok I’ll try to take a look over the weekend as I’ve no more time today… However I strongly encourage you to drop the approach of using an is-Overlapping BP Node plus is-Overlapping Bool etc… Instead…

  1. Create a new blueprint derived from actor, containing just a single Box-Collision volume (not 2). 2. Name this BP ‘lock-system’ or something etc, and drag it into the level instead of what you have. 3. Create two new events inside this BP: On-Component-Begin-Overlap and On-Component-End-Overlap using the Box-Collision component.

  2. Then when your Character / Pawn enters the Box-Collision-Volume have the begin-overlap event set a material on the key/lock-mesh etc to visually show the player can ‘affect’ the lock. 4. Then on the end-overlap, reverse the material change (for when the Player walks away etc).

  3. Afterwards copy over your F-keypress code. But this time use a Gate node. Enable the Gate when the begin-overlap is called, and disable the Gate when the end-overlap is called…

  4. In the class settings make sure the ‘lock-system’ BP is set to receive keyboard input from Player-0 too… Try this, as I can’t encourage you enough to get away from what you have right now!

I am told I do have twisted logic so.

Though the begin overlap and end overlap opening and closing a gate seems like a great idea. I plan to have a yellow emissive overlay per se on the lock to let players know they can open the door this is early stages of just getting the mechanics to work. Though this project is not meant to be AAA type it is a quick and dirty project for something else. Legit 4 months limit on it. I only have a months experience at most in Unreal :stuck_out_tongue: soooo… lol.

Okay now somehow the key broke lol.

https://youtu.be/NfEc0XRlsak

Ok, so what’s happening now, talk us through that video etc… The ultimate run in the Video seems to show it working?.. BTW: Its common to size the lock-box volume larger, so that there’s no risk of the player approaching the door and not triggering it. What is the square collision box around the Character for too, is that used here? Anyway the standard way to do this is just rely on the default capsule-collision of the TPcharacter overlapping the volume of the interactable object…

It shows it working without the key. I was working on another project. I will test out some things later and tell you. The reason why it works without the key is now it is registering proper to a degree but the key now isn’t even though it is at the source. The square box sticking out is the overlapping bit with the other overlapping bit so it overlaps fully. I tried overlapping player I will try the capsule thing later when I can work on it again. Will be a day or so.