Tick function not triggering

Hi!!

I have created a class based on TriggerBox class, but Tick function is not working on it…

is there any requeriment to use Tick functions ?.. works with some and some other not?..

Thanks in advance…

CanEverTick has to be set to true in the constructor. It is disabled by default in C++.


PrimaryActorTick.bCanEverTick = true;

If it is also a Blueprint it could be set to “Start with Tick Enabled” in Class Default or it can be set in BP event graph with the SetActorTickEnabled function.

Thanks, it already has the bCanEverTick property set to true on constructor, I have figured out that if I change the inheritance from ATriggerBox to AActor, Tick function works again… but trigger functions do not… So I needed to split my class, one for the Actor, other for Trigger…

That’s odd.

  • AActor

    • TriggerBase

      • TriggerBox

A TriggerBox inherits from AActor so something is not right in your TriggerBox class.

yes, is really odd it indeed depends of AActor, but i´m sure my class is right, because the same was happening with an AActor inherited class, i then commented all my things keeping the class as if i was creating a new one, compiled and uncommented, then Tick started to work again… i guess if i do the same with my trigger box class, should work…

I stumbled across a reason why this might not be working for you - When you compile a blueprint, a flag is set on the class that indicates if the tick function is overridden For that class. If you only override the tick function on the base class, then expect the derived class to tick the base class’ tick, it won’t run unless you also explicitly call the base class’ tick from the derived class.

You can read the source in WidgetBlueprintCompiler.cpp ln 626 in UEd version 5.2.1.