I created a blueprint for an NPC character: each character has a collision box and sets a personal timer on EventBeginPlay. My goal is to pause the timer when my player controller enters the character’s collision box and to resume when it leaves.
As you can see, this timer lasts 5 seconds, is looping and calls Jump() at each iteration (actually, it prints a string saying “Jump.”).
When I enter or leave the collision box, OnComponentBeginOverlap() and OnComponentEndOverlap() are called respectively. (They are located on the same EventGraph of the Blueprint’s EventBeginPlay.) Both call a function called Interact() which passes a boolean and calls Pause() or Unpause() for the current timer.
My problem is that the timer never pauses. It keeps triggering every 5 seconds without a hitch even though my script flows through the Interact function (yup, with the glowing flow that highlight the nodes …). I later added some functions to Pause() and Unpause() but nothing goes through them, so there’s a problem with calling those functions here. I assume that all references to objects default to 'self: i.e. the character’s blueprint.
Can anyone see what I’m doing wrong ?