Removing Event Tick call?

Hi, I have a lock box mechanic that I have working, however I need/want to remove it from checking if it has been opened every tick to call the unlock function. I have tried a couple ways to go about this but keep running into the issue of not knowing exactly what to cast and how to navigate between the blueprints. Below are the blueprints I am using to perform the task.

One thing to note, “view” is just a variable assigned to the WBP to allow me to call it outside of the Lockbox BP class




You probably don’t want to include the level blueprint at all.

If the widget knows which lockbox it’s affecting, can’t it just call “Open” on the lockbox when it gets into the “unlocked” state?
Or maybe call into the lockbox, saying “here’s the current code,” each time the code changes, and the box can then decide whether it opens itself.

forgive me I am pretty new to all of this but, I am not sure exactly how to call it. It knows which one to destroy/interact with since I added it as a view variable, inside of LockBox_BP

However, inside of WBP_ComboLock I don’t have/Don’t know how to get a specific reference to the actor that it is being called from.

Typically, it’ll work something like:

  1. the playercontroller, in on begin play, adds its appropriate UI widgets to the player screen; some of them may be hidden
  2. lock box will have a trigger volume that overlaps only pawns
  3. when some pawn enters the box, the box gets the controller of the pawn and attempts to cast to your player controller class
  4. assuming the cast works, the box will call “set current box” on that player controller
  5. the player controller implements the function “set current box” to remember which box is current, show the box unlock UI, and tell the box unlock UI which box is current
  6. the box, when a pawn leaves the trigger area, will similarly call “unset current box” on the player controller, and the player controller will hide the UI and unset the reference
  7. the UI now has a reference to the box, so when the player changes the code, you can forward the new code to the box
  8. the box, inside its “new code” function, will check whether it’s right, and the the needful