Compare commits

...

4 Commits

Author SHA1 Message Date
baz 18ab3a5434 Create RedKeycardPickup 2024-03-12 19:58:13 +00:00
baz 11461c7b61 Move HealthPickups to Pickups folder 2024-03-12 19:56:58 +00:00
baz a962301840 Add Keycard Asset 2024-03-12 19:56:28 +00:00
baz 1b32434d98 Fix static mesh inhabiting the incorrect position 2024-03-12 19:56:17 +00:00
11 changed files with 25 additions and 14 deletions

BIN
Content/Assets/Keycard/M_KeycardBody.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Assets/Keycard/M_KeycardIndent.uasset (Stored with Git LFS) Normal file

Binary file not shown.

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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