erste Wände für Fabrik

This commit is contained in:
Johannes Theiner 2021-02-02 14:09:40 +01:00
parent 3948977b53
commit 5b798d4f3b
Signed by: joethei
GPG Key ID: 9D2B9A00FDA85BCD
10 changed files with 16 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -16,17 +16,27 @@ void UMovingActor::BeginPlay()
void UMovingActor::Move()
{
targetLocation = GetOwner()->GetActorLocation();
targetLocation.X += MovementTarget;
tempLocation = FVector(MovementSpeed, 0.0f, 0.0f);
if (Negative)
{
targetLocation.X -= MovementTarget;
targetLocation.Y += MovementTarget;
tempLocation = FVector(0.0f, MovementSpeed, 0.0f);
}
if(!Negative)
{
targetLocation.X += MovementTarget;
tempLocation = FVector(MovementSpeed, 0.0f, 0.0f);
}
if(Up)
{
targetLocation.Z += MovementTarget;
tempLocation = FVector(0.0f, 0.0f, MovementSpeed);
}
this->targetLocation = targetLocation;
this->moving = true;
UE_LOG(LogTemp, Warning, TEXT("%f %f %f"), targetLocation.X, targetLocation.Y, targetLocation.Z)
UE_LOG(LogTemp, Warning, TEXT("%f"), MovementSpeed)
TArray<UAudioComponent*> Audios;
GetOwner()->GetComponents<UAudioComponent>(Audios);
@ -46,7 +56,6 @@ void UMovingActor::Move()
Audio->Play();
}
}
soundHasBeenPlayed = true;
}

View File

@ -36,6 +36,9 @@ public:
UPROPERTY(EditAnywhere)
bool Negative = false;
UPROPERTY(EditAnywhere)
bool Up = false;
private:
bool moving;
bool soundHasBeenPlayed;