2017-12-25 17 views
-2

Ich kann nicht herausfinden, was mit dem Makro, das den Spielerstandpunkt protokolliert, falsch ist. Soweit ich das beurteilen kann, muss mir ein "include which you use" Hash fehlen, aber ich kann nicht herausfinden, was es ist. Ich habe alles ausprobiert, was ich mir vorstellen kann, googelte wie verrückt, könnte etwas mit Conversions von FRotator und Vectors zu tun haben, um im Makro zur Konsole auszugeben.Was ist mit diesem Makro falsch?

// Copyright Josh Marino 2017 

#include "Grabber.h" 
#include "PositionReport.generated.h" 
#include "CoreMinimal.h" 
#include "Engine/World.h" 

// Sets default values for this component's properties 
UGrabber::UGrabber() 
{ 
    // 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 UGrabber::BeginPlay() 
{ 
Super::BeginPlay(); 

UE_LOG(LogTemp, Warning, TEXT("Grabber reporting for Duty!")) 

} 

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

// Get Player viewpoint viewpoint 
FVector PlayerViewPointLocation; 
FRotator PlayerViewPointRotation; 
GetWorld()->GetFirstPlayerController()->GetPlayerViewPoint(
    PlayerViewPointLocation, 
    PlayerViewPointRotation 
); 

// Log Out To Test 

UE_LOG(LogTemp, Warning, TEXT("Location: %s Position: %s") *PlayerViewPointLocation.ToString(), *PlayerViewPointRotation.ToString()) 

// Ray-Cast out to reach distance 


// See what we hit 


} 
+0

Was Makro? Und was ist der Fehler? – interjay

Antwort

0

aus irgendeinem Grund jetzt funktioniert es ........ Makros sind dumm

#include "Grabber.h" 
#include "PositionReport.generated.h" 
#include "CoreMinimal.h" 
#include "Engine/World.h" 


// Sets default values for this component's properties 
UGrabber::UGrabber() 
{ 
    // 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. 
    bWantsBeginPlay = true; 
    PrimaryComponentTick.bCanEverTick = true; 

    // ... 
} 


// Called when the game starts 
void UGrabber::BeginPlay() 
{ 
    Super::BeginPlay(); 
    UE_LOG(LogTemp, Warning, TEXT("Grabber reporting for duty!")); 

} 


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

    // Get player view point this tick 
    FVector PlayerViewPointLocation; 
    FRotator PlayerViewPointRotation; 
    GetWorld()->GetFirstPlayerController()->GetPlayerViewPoint(
     OUT PlayerViewPointLocation, 
     OUT PlayerViewPointRotation 
    ); 
    // TODO Log out to test 
    UE_LOG(LogTemp, Warning, TEXT("Location: %s, Rotation: %s"), 
     *PlayerViewPointLocation.ToString(), 
     *PlayerViewPointRotation.ToString() 
    ) 

     // Ray-cast out to reach distance 

     // See what what we hit 

} 
+0

Sieht so aus, als ob Sie Ihre eigene Frage beantwortet haben ... – QuIcKmAtHs

+1

Nun, es funktioniert eindeutig besser, wenn Sie ein Komma nicht vergessen;) – Quentin

+0

ja ich habe meine eigene Frage beantwortet lol, es lässt mich einfach meine Antwort nicht annehmen – RandomNamedotDevingHard