// Fill out your copyright notice in the Description page of Project Settings. #include "WorldPosition.h" #include "GameFramework/Actor.h" // Sets default values for this component's properties UWorldPosition::UWorldPosition() { // 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 UWorldPosition::BeginPlay() { Super::BeginPlay(); // ... FString ObjectName = GetOwner()->GetName(); FString ObjectPosition = GetOwner()->GetActorLocation().ToString(); UE_LOG(LogTemp, Warning, TEXT("%s"), *ObjectName); UE_LOG(LogTemp, Warning, TEXT("%s"), *ObjectPosition); UE_LOG(LogTemp, Warning, TEXT("My name is: %s"), *GetOwner()->GetName()); UE_LOG(LogTemp, Warning, TEXT("My worldPosition is: %s"), *GetOwner()->GetActorLocation().ToString()); } // Called every frame void UWorldPosition::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); // ... } //comment //part 1 // UE_LOG(LogTemp, Warning, TEXT("This is a Warning")); // UE_LOG(LogTemp, Error, TEXT("This is an Error")); // UE_LOG(LogTemp, Display, TEXT("This is a Normal Message")); // FString Log = TEXT("Hello"); // FString* LogPtr = &Log; // Log.Len(); // (*LogPtr).Len(); // .Len wird zuerst ausgeführt, damit variable erreichbar () benutzen // LogPtr->Len(); // -> zum aufruf von methoden von werten auf den pointer zeigen // UE_LOG(LogTemp, Warning, TEXT("%s"), *Log); // UE_LOG(LogTemp, Warning, TEXT("%s"), **LogPtr); // FString OwnerName = GetOwner()->GetName(); // UE_LOG(LogTemp, Warning, TEXT("%s"), *OwnerName); // UE_LOG(LogTemp, Warning, TEXT("My name is: %s"), *GetOwner()->GetName());