How to add varaiable into actor.h

Hi everyone. I want to add a new varaiable into actor.h. I have uesd

public:

UPROPERTY(EditAnywhere,BlueprintReadWrite, Category=Actor)

   int32 Team_ID;

It compiled successfully but I can’t find this varaiable from its inheritance classes.

So can someone give me a favor? Thank you.

You made this change in the engine source?

yes,but I don’t know if this is feasible.

Unless you are using a c++ compiled engine you have downloaded from the github or Unreals other source control changes made to the engine code won’t actually show up. The engine code you have in the versions on the launcher is more for reference than anything else.

It is feasible but there is generally no reason to do so.

You can create a new c++ class that inherits from Actor that has your new variable in it and you can do that without recompiling the engine (or risking messing up the code).

Thank your advice. I’ll try this later.

Thank you, HarryHighDef. Now I knew the reason. And I’ll create a new c++ class to do it.