Hi Everyone,
I have a simple AUTWeaponSet class extending AUTPickup and I’m trying to get some simple variables appearing in the editor. Most of the other questions I’ve seen are concerned with the variable appearing in the blueprint, but I’m just worried about the editor. Here’s my code for my variable which should be appearing in the Test category with the name testTest:
UCLASS(Blueprintable, Abstract)
class UNREALTOURNAMENT_API AUTWeaponSet : public AUTPickup
{
GENERATED_UCLASS_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
int32 testTest;
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
};
If I copy and paste this code in any other class, such as AUTPickup, it shows up but it does not show up in my custom class. If you have any advice, I would greatly appreciate it.
Ok, just another stab as I haven’t played with them, have you tried replacing the GENERATED_UCLASS_BODY() with GENERATED_BODY() and just having UCLASS() empty? It should still be visible to Blueprints from what I can tell…
Which version of UE are you using, for older versions you won’t need the “int32 AUTWeaponSet::GetMyValue_Implementation(void)” line in your header, later versions remove the auto declaration of it.
Ah yeah, sorry. I tried that earlier, but I was getting an error due to the auto-generation. You were right, the second line was not needed. I have that function in my header file and the implementation in the .cpp and its still not showing up!
Anyone else have any suggestions? I would love to really get started on development, but this simple issue is causing me massive headaches and roadblocks.
Downloaded and built Unreal Tournament 4 code base
Opened the UE4Editor.exe, clicked on a random weapon base, clicked add C++ component
Clicked New Actor Component
Named it UTWeaponSet for the .h and .cpp files
Went to the UTWeaponSet.h and made my AUTWeaponSet class inherit AUTPickup (I think I need this because I’m making a weapon set class that can store user specified guns)
As a test to see if my future changes affected the editor, I made a simple UProperty int
Built UnrealTournament project, editor recompiled, and changes did not appear in editor. Note that if I put that variable into any other class such as UTPickup, it shows up
Sorry for the delayed response. Following the steps you provided I selected a weapon base and used the AddComponent button to create an Actor Component class. When this class opened in Visual I added the UPROPERTY() variable to the header file and compiled again. Back in the editor I added the new component to the weapon base and the variable was present.
This was using the release branch for Unreal Tournament (https://github.com/EpicGames/UnrealTournament/tree/release) that was updated within the last day. Let me know if there was something that I did differently from your setup or if you’re still having the same issue with the latest version of the source code from GitHub.