Compare commits

..

No commits in common. "18ab3a54346dc514647ecc9da63cad857759124f" and "e2e32e009234a8c66c16dad11aeeba6582899c99" have entirely different histories.

11 changed files with 14 additions and 25 deletions

Binary file not shown.

Binary file not shown.

BIN
Content/Assets/Keycard/SM_Keycard.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/Blueprints/HealthPickups/HealthCross.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Blueprints/HealthPickups/HealthPickupMaterial.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Blueprints/HealthPickups/TestHealthPickup.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -14,8 +14,9 @@ AStaticMeshPickup::AStaticMeshPickup()
void AStaticMeshPickup::BeginPlay() void AStaticMeshPickup::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
StartingLocation = StaticMeshComponent->GetRelativeLocation(); StaticMeshComponent->SetWorldLocation(this->GetActorLocation());
StartingLocation = this->GetActorLocation();
StaticMeshComponent->SetCollisionProfileName(FName("NoCollision")); StaticMeshComponent->SetCollisionProfileName(FName("NoCollision"));
} }
@ -25,10 +26,10 @@ void AStaticMeshPickup::Tick(float DeltaTime)
if (StaticMeshComponent) if (StaticMeshComponent)
{ {
// Rotate StaticMesh in desired direction // Rotate Weapon in desired direction
StaticMeshComponent->AddLocalRotation((SpinRotation * RotationSpeed) * DeltaTime); StaticMeshComponent->AddLocalRotation((SpinRotation * RotationSpeed) * DeltaTime);
// Bob StaticMesh up and down // Bob weapon up and down
const float Time = GetWorld()->GetRealTimeSeconds(); const float Time = GetWorld()->GetRealTimeSeconds();
const float Sine = FMath::Abs(FMath::Sin(Time * MovementSpeed)); const float Sine = FMath::Abs(FMath::Sin(Time * MovementSpeed));
StaticMeshComponent->SetRelativeLocation(StartingLocation + ((MovementDirection * Sine) * MovementDistance)); StaticMeshComponent->SetRelativeLocation(StartingLocation + ((MovementDirection * Sine) * MovementDistance));