Get the name of the actor overlaping with pressure plate

Hi there i have an issue that when ever the pawn overlap with the pressure plate or the chair or the table , i dont get the name of the actors instead i get something like this :
{ emp: Warning: 26635450750n Pressure Plate
LogTemp: Warning: 146054500n Pressure Plate
LogTemp: Warning: 26635451020n Pressure Plate
LogTemp: Warning: 146054500n Pressure Plate
LogTemp: Warning: 26635451070n Pressure Plate
LogTemp: Warning: 146054500n Pressure Plate
LogTemp: Warning: 26635451140n Pressure Plate
LogTemp: Warning: 146054540n Pressure Plate
LogTemp: Warning: 26635451210n Pressure Plate
LogTemp: Warning: 146054500n Pressure Plate
LogTemp: Warning: 26635451260n Pressure Plate
LogTemp: Warning: 146054500n Pressure Plate
LogTemp: Warning: 26635452410n Pressure Plate
LogTemp: Warning: 146054500n Pressure Plate
LogTemp: Warning: 26635452720n Pressure Plate
LogTemp: Warning: 146054500n Pressure Plate
LogTemp: Warning: 26635452770n Pressure Plate
LogTemp: Warning: 146054440n Pressure Plate
LogTemp: Warning: 26635453300n Pressure Plate
LogTemp: Warning: 146054440n Pressure Plate
LogTemp: Warning: 26635451330n Pressure Plate
LogTemp: Warning: 146054440n Pressure Plate
LogTemp: Warning: 26635452530n Pressure Plate
LogTemp: Warning: 146054400n Pressure Plate
LogTemp: Warning: 26635454240n Pressure Plate
LogTemp: Warning: 146054400n Pressure Plate
LogTemp: Warning: 26635453110n Pressure Plate
LogTemp: Warning: 146054500n Pressure Plate
LogTemp: Warning: 26635453420n Pressure Plate
LogTemp: Warning: 146054500n Pressure Plate
LogTemp: Warning: 26635453660n Pressure Plate
LogTemp: Warning: 146054500n Pressure Plate
LogTemp: Warning: 26635455060n Pressure Plate
LogTemp: Warning: 146054500n Pressure Plate
LogTemp: Warning: 26635454360n Pressure Plate
LogTemp: Warning: 146054500n Pressure Plate
LogTemp: Warning: 26635455700n Pressure Plate
LogTemp: Warning: 146054340n Pressure Plate
LogTemp: Warning: 26635456760n Pressure Plate
LogTemp: Warning: 146054340n Pressure Plate
LogTemp: Warning: 26635457770n Pressure Plate
LogTemp: Warning: 146054340n Pressure Plate
LogTemp: Warning: 26635461120n Pressure Plate
LogTemp: Warning: 146054340n Pressure Plate
LogTemp: Warning: 26635455200n Pressure Plate
LogTemp: Warning: 146054340n Pressure Plate
LogTemp: Warning: 26635455750n Pressure Plate
LogTemp: Warning: 146054400n Pressure Plate
LogTemp: Warning: 26635457030n Pressure Plate
LogTemp: Warning: 146054400n Pressure Plate
LogTemp: Warning: 26635460040n Pressure Plate
LogTemp: Warning: 146054340n Pressure Plate
LogTemp: Warning: 26635461170n Pressure Plate
LogTemp: Warning: 146054340n Pressure Plate
LogTemp: Warning: 26635462130n Pressure Plate
LogTemp: Warning: 146054340n Pressure Plate
LogTemp: Warning: 26635462200n Pressure Plate
LogTemp: Warning: 146054300n Pressure Plate
LogTemp: Warning: 26635462250n Pressure Plate
LogTemp: Warning: 146054300n Pressure Plate
LogTemp: Warning: 26635462320n Pressure Plate}

how can i fix this?

heres the Open_Door.cpp:

// Crying Bullet copyright 2017

#include “Open_Door.h”
#include “Gameframework/Actor.h”
#define OUT

// Sets default values for this component’s properties
UOpen_Door::UOpen_Door()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don’t need them.
PrimaryComponentTick.bCanEverTick = true;

// ...

}

// Called when the game starts
void UOpen_Door::BeginPlay()
{
Super::BeginPlay();
Owner = GetOwner();
}

void UOpen_Door::OpenDoor()
{
Owner->SetActorRotation(FRotator(0.0f, OpenAngle, 0.0f));
}

void UOpen_Door::CloseDoor()
{
Owner->SetActorRotation(FRotator(0.0f, 0.0f, 0.0f));
}

// Called every frame
void UOpen_Door::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

if (GetTotalMassOfActorOnPlate()>30.0f) //TODO make it into a parameter 
{
	Owner->SetActorRotation(FRotator(0.0f, OpenAngle, 0.0f));
	LastDoorOpenTime = GetWorld()->GetTimeSeconds();
}

if (GetWorld()->GetTimeSeconds() - LastDoorOpenTime > DoorCloseDelay)
{
	Owner->SetActorRotation(FRotator(0.0f, 0.0f, 0.0f));
}

}

float UOpen_Door::GetTotalMassOfActorOnPlate()
{
float TotalMass = 0.f;

//find all the overlapping actors
TArray<AActor*> OverlappingActors;
PressurePlate->GetOverlappingActors(OUT OverlappingActors);

//Iterate through them adding their masses 
FString JoinedStr;
for (const auto* Actor : OverlappingActors)
{
	TotalMass += Actor->FindComponentByClass<UPrimitiveComponent>()->GetMass();
	UE_LOG(LogTemp, Warning, TEXT("% on Pressure Plate"), *Actor->GetName())
}
	return TotalMass;

}

And The Open_Door.h:

// Crying Bullet copyright 2017

#pragma once

#include “Engine.h”
#include “Components/ActorComponent.h”
#include “Open_Door.generated.h”

UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class ESCAPE_THEROOM_API UOpen_Door : public UActorComponent
{
GENERATED_BODY()

public:
// Sets default values for this component’s properties
UOpen_Door();

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

void OpenDoor();
void CloseDoor();

public:
// Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;

private:

UPROPERTY(EditAnywhere)
	float OpenAngle = 90.0f;
UPROPERTY(EditAnywhere)
	ATriggerVolume* PressurePlate; 
UPROPERTY(EditAnywhere)
	float DoorCloseDelay = 1.0f;
	float LastDoorOpenTime;
//returns total mass in KG 
float GetTotalMassOfActorOnPlate();
	
	AActor* Owner;

};

i fotgot s after the %s :joy:

Privacy & Terms