I have an AActor-derived class defined in pure C++. I have an instance of it in my level that is not having its Tick function called. It used to work, and at some point it broke, and I don’t know why. Here’s the confusing part for me: if I add another instance of the AActor to my level, the new one ticks fine! (The original still does not.)
My constructor defines the usual things (and more, out of desperation):
PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.bStartWithTickEnabled = true;
PrimaryActorTick.bAllowTickOnDedicatedServer = true;
If I set a breakpoint in the BeginPlay function, I can plainly see that PrimaryActorTick.bCanEverTick is now equal to False for the broken instance, even though I watch it get set to true in the constructor. For the instance that ticks, PrimaryActorTick.bCanEverTick is equal to true in BeginPlay. So something is plainly different about my two Actors, even though they are coming from the same C++ class.
Does anyone know why this might be happening? I can just replace the broken actor in the editor, but I’d like to understand what the problem is. I think there is something important about object lifecycles regarding the editor that I am missing, and it’s driving me crazy.
Thank you!