Thanks BeeGeeDee, up until now … I would have said exactly the same.
The only reasonable conclusion here is that Unreal is it seems … recreating the components. Or perhaps some sort of object pooling. Not sure.
The level is complicated, however there is 1BP that has 1 Mover component attached to it. There are no other MoverComponents attached to anything.
The sequence is:
- Build / Livecode
- BeginPlay
- Click “Should Move” on Mover ( in my mover I do the move, and then uncheck this )
- Click “Should Move” on Mover again ( this should return to start, but does not )
So my real problem is that my class state is reset ( which naturally if the constructor is being re-called ). What I find VERY interesting is that all the timestamps match even though sequentially in the log they appear at the above events.
I will amend my question then to this: How do I effectively store component state while attached to a blueprint?
# Logging in constructor ( UMoverComponent::UMoverComponent() )
UE_LOGFMT(LogTemp, Warning, "Constructor ({is})({who})", isForward, GetFName());
# After build
Mon Mar 25 21:53:28 EDT 2024 Warning LogTemp Constructor (true)(Default__MoverComponent)
# After BeginPlay
Mon Mar 25 21:53:28 EDT 2024 Warning LogTemp Constructor (true)(Mover)
# After I first "Should Move" toggle
Mon Mar 25 21:53:28 EDT 2024 Warning LogTemp Constructor (true)(Mover)
# After second "Should Move"
Mon Mar 25 21:53:28 EDT 2024 Warning LogTemp Constructor (true)(Mover)