Errors In code after build but Successful (?)

After Writing code as I was following Sam I came up with errors I can’t fix I tried matching code to git files but they match. but when I build it in VS Succesful, Any feedback is awesome…

Images / code

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


#include "FireArm.h"

#include "Components/SkeletalMeshComponent.h"

// Sets default values
AFireArm::AFireArm()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

	Root = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
	SetRootComponent(Root);

	Mesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Mesh"));
	Mesh->SetupAttachment(Root);

}

// Called when the game starts or when spawned
void AFireArm::BeginPlay()
{
	Super::BeginPlay();
}

// Called every frame
void AFireArm::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

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

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "FireArm.generated.h"


UCLASS()
class DISCORDANT_API AFireArm : public AActor
{
	GENERATED_BODY()

public:
	// Sets default values for this actor's properties
	AFireArm();

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

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

private:
	UPROPERTY(VisibleAnyWhere)
	USceneComponent* Root;

	UPROPERTY(VisibleAnyWhere)
	USkeletalMeshComponent* Mesh;

};

I didn’t find anything wrong in your code. Can you post the error? Also, does your game work as expected?

1 Like

Are you talking about the red underline? Just ignore it.

Okay, Thank you

Yes it does work as expected. At one point there was an error but after build in when away but left red underline on to cpp files…Thank you

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms