Description

Setting PrimaryComponentTick.bCanEverTick in a custom actor component's constructor does not does not stop the component from ticking after compile.

Steps to Reproduce
  1. Open UE4 Editor (Any project)
  2. Add code based on ActorComponent (MyActorComp)
  3. Make the following changes to MyActorComp.cpp
    • Add include statement for Engine.h
    • Add the following to TickComponent() function
      	if (GEngine)
      	{
      		GEngine->AddOnScreenDebugMessage(-1, 4.f, FColor::Magenta, TEXT("Component Is Ticking"));
      	}
      
  4. Compile
  5. In the editor, create a blueprint based on actor (MyActorBP)
  6. Add instance of MyActorComp to MyActorBP component hierarchy
  7. Add instance of MyActorBP to the level and PIE (note that debug message prints)
  8. In MyActorComp.cpp, Set PrimaryTickComponent.bCanEverTick to false in constructor
  9. Compile with the editor open (Hot reload)
  10. PIE

Result:
Debug message is still shown on screen

Expected:
Debug message is not printed since component is set to not tick.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

11
Login to Vote

Won't Fix
ComponentUE - Gameplay - Components
Affects Versions4.14.34.154.19
CreatedMar 15, 2017
ResolvedAug 18, 2021
UpdatedAug 18, 2021
Pull Requests
5830 - Algorithman