erste Wände für Fabrik
This commit is contained in:
parent
3948977b53
commit
5b798d4f3b
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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;
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,9 @@ public:
|
||||
UPROPERTY(EditAnywhere)
|
||||
bool Negative = false;
|
||||
|
||||
UPROPERTY(EditAnywhere)
|
||||
bool Up = false;
|
||||
|
||||
private:
|
||||
bool moving;
|
||||
bool soundHasBeenPlayed;
|
||||
|
Loading…
Reference in New Issue
Block a user