I’m trying to implement a Lock/Unlock system

I’m trying to implement a Lock/Unlock system in my project.

As you can see in the image, I’ve set up a Box Collision to control the Lock/Unlock functionality. The goal is to allow only the characters inside the box to perform the Lock/Unlock action.

The system works fine when a character inside the box tries to Lock/Unlock. However, the problem arises when a character outside the box can also trigger the Lock/Unlock action. This happens because there is already a character inside the box, and the condition always evaluates to True.

What I want to achieve is:

  • Only the characters inside the Box Collision should be able to perform the Lock/Unlock action.
  • Characters outside the box should not be able to trigger this functionality.

Could you please suggest a few ideas on how to implement this correctly? Thank you!

1 Like

From other class make a get class node and then do = and set to the bp class you want only to have access to the door/ who can open and close it. if you want others to have access then you add a or bolean to the branch