Hi, Im trying to assign a value to a variable by using the same class but it doesn
t work.
Here is the class`s definition (in the header file):
class UFloatintPawnMovement;
Here is the code in the cpp file:
#include “GameFramework/FloatingPawnMovement.h”
#include “Components/StaticMeshComponent.h”
// Sets default values
AGayMan::AGayMan()
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
SM_Paddle = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("meeeeeeeeeeeee"));
RootComponent = SM_Paddle;
SM_Paddle->SetEnableGravity(false);
SM_Paddle->SetConstraintMode(EDOFMode::XYPlane);
SM_Paddle->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
SM_Paddle->SetCollisionProfileName(TEXT("PhysicsActor"));
//here is the problam line:
FloatingMovement = CreateDefaultSubobject<UFloatingPawnMovement>(TEXT("Floating Pawn Movement"));
}
// Called when the game starts or when spawned
void AGayMan::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AGayMan::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
// Called to bind functionality to input
void AGayMan::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
}
void AGayMan::MoveHorny(float AxisValue)
{
AddMovementInput(FVector(AxisValue, 0.0f, 0.0f), 1.0f, false);
}
And here is the error:
Severity Code Description Project File Line Suppression State
Error (active) E0513 a value of type “UFloatingPawnMovement *” cannot be assigned to an entity of type “UFloatintPawnMovement *”