C++ class does NOT appear in Content Browser

After creating a C++ class in Visual Studio, and built it. It was successful. However, after saving, exiting VS2017, and restarting my Unreal Engine Project, the new C++ classes would not appear on the content browser.

Also, inside Visual Studio, the solution platform and solution configuration were grayed out, and I could not change them.

What do I do to fix these issues?

Most likely hot reload issue, you project run on outdated dlls of you module. Turn off editor, run VS project, compile (UBT should delete hotreload dlls with numbers) and try to run it now everything should be back in sync.

If you ever have any “I see it in the code but i don’t see it in engine” situation is it hot reload issue as it not 100% perfect and aspecially don’t like to derp on things like new classes and edit there structure. In all those cases compiling on close editor should help out, compiling with closed editor is healthiest way, use hot reload for quick changes

If that doesn’t help rebuild, if this still does not help delete sln file and intermediate folder (which will delete all the object files) and right click uproject file and regenerate VS project files.

Also instead of relying on Contend Browser use Class Viewer (Windows->Developer Tools->Class Viewer)

Would be great if you can attach at least headers of your class, as of now I can suggest 2 issues:

  1. If your class is derived from UObject, it is probably a reloading issue, as mentioned above. Try regenerate VS files in your project directory. Delete “intermediate”, “.vs” and “binaries” folders, then RMB click on your project file and choose “Generate Visual studio files”.

  2. If your class is custom class(that is not a UObject-derived), I think it won’t appear (correct me if I am wrong).

Regards,
Alex.

2 Likes

Well, I am following a video guide in which Win7 is still used so it is entirely possible, that in that version of UE4, the C++ class will still appear, but in UE4.20, it doesn’t, so I will try and just continue with the lessons, and see how it goes.

Well, new information has come to light, and apparently, in the TwinStickShooter guide I am following, I need to RMB click on the C++ class in the content browser, in order to follow the guide. However: Here is my header code, from BaseCharacter.h:

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "BaseCharacter.generated.h"

UCLASS(Blueprintable)
class TWINSTICKSHOOTERV2_API ABaseCharacter : public ACharacter
{
	GENERATED_BODY()


public:

//Make a health poroperty
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Base Character")
		float Health = 100;
//Make an is dead propoerty
	UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = "Base Character")
		bool isDead = false;

//Calcualate death function
	virtual void CalculateDead();

//calculate health function
	UFUNCTION(BlueprintCallable, Category = "Base Character")
		virtual void CalculateHealth(float delta);



#if WITH_EDITOR
//Editor-centric code for changin properties
	virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
		override;
#endif

public:
	// Sets default values for this character's properties
	ABaseCharacter();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	// Called to bind functionality to input
	virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;

}

Click on “Recompiles and reloads C++ cod for game system on the fly” (in down-left corner button of the screen UE).