keywiz
(keywiz)
December 16, 2016, 7:21pm
1
Hi,
I have a UActorComponent, here is my constructor
USwitchComponent::USwitchComponent()
{
PrimaryComponentTick.bCanEverTick = false;
PrimaryComponentTick.bStartWithTickEnabled = true;
PrimaryComponentTick.TickGroup = TG_PrePhysics;
bAutoRegister = true;
bWantsInitializeComponent = true;
bAutoActivate = true;
}
But TickComponent not got called, I add everything I read in the AnswerHUB.
The component is attached to a staticmesh (I set to moveable too), the Component is not a SceneComponent.
Any ideas? I try all in my knowledge.
thanks
RicardoDC
(RicardoDC)
January 10, 2017, 5:49am
2
I think you shoud change:
PrimaryComponentTick.bCanEverTick = true ;
1 Like
RicardoDC
(RicardoDC)
January 10, 2017, 7:06am
3
I had a similar problem but in my case, In BeginPlay() method, I forgot to call Super::BeginPlay() and Tick Stoped working.
Fulezi
(Fulezi)
February 20, 2023, 4:59pm
4
In my case this was caused by a Hot-reload issue.
Solution was to recreate a variable
Symptoms: The BeginPlay
was called. If I added the component via blueprint it worked, but Tick
method was not called if I add the component via c++ .
Solution:
I created duplicated the variable name and creation with 2
and it worked
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category=Input)
UPlayerAimingComponent* PlayerAimingComponent2;
// ...
PlayerAimingComponent2 = CreateDefaultSubobject<UPlayerAimingComponent>(TEXT("PlayerAimingComponent2"));
double-check that BeginPlay is called.