Download

FAQ: Code

Dec 6, 2020.Knowledge

Are UE4 Enum labels expected to be reorderable?

  • Enums are serialized as FNames so that when their values change they get resolved to the new values on load. Many enums are runtime-only. A few read from ini files and a few have indices that need other code to be simultaneously modified.

Best Practice for recompiling code, Gameplay/Editor-code (LiveLink, Hot reload or Recompile module from editor)?

  • Hot reload is not used much internally, as it is not stable with some of the ways in which our projects are setup. That said, some studios and independent developers have had success using it. LiveCoding has become a very successful workflow for many engineers internally. Unlike hotreload, it currently has no awareness of UE reflection markup, so you can’t modify uclass/property/function markups or introduce new properties and functions and have it reflect in the running editor instance. However, for standard c++ code behaviors it is generally quite effective.

Could you explain the effects of unchecking Enable Actor Tick in class defaults and of unchecking Can Blueprints Tick by Default in Project settings?

  • The tooltip for Can Blueprints Tick by Default should explain the different scenarios. If this setting is disabled, the actor tick settings in class defaults won’t be relevant.
    • Blueprints that derive from native C++ classes that have bCanEverTick=true will always be able to tick
    • Blueprints that derive from exactly AActor or UActorComponent will always be able to tick
    • Otherwise, they can tick as long as the parent doesn’t have meta=(ChildCannotTick) and either bCanBlueprintsTickByDefault is true or the parent has meta=(ChildCanTick)
  • Put another way, a blueprint will tick if all the following are true:
    • The native parent class does not have the ChildCannotTick metadata
    • Either Blueprints Tick by Default is true, or the native parent class has the ChildCanTick metadata
    • Either Start with Tick Enabled is checked on the actor in class defaults, or tick is explicitly enabled
    • The blueprint implements the Tick event