(Feat) Add footsteps
This commit is contained in:
@@ -52,11 +52,10 @@ AStorageContainer::AStorageContainer()
|
||||
// FitInteractionBox() l'ecrase des qu'il y en a un.
|
||||
InteractionBox->SetBoxExtent(FVector(40.f, 30.f, 30.f));
|
||||
|
||||
LidPivot = CreateDefaultSubobject<USceneComponent>(TEXT("LidPivot"));
|
||||
LidPivot->SetupAttachment(BaseMesh);
|
||||
|
||||
// Enfant direct de la caisse : c'est le mesh lui-meme qu'on tourne, donc la
|
||||
// charniere est le pivot que le pack a donne a SM_Chest_Top.
|
||||
LidMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("LidMesh"));
|
||||
LidMesh->SetupAttachment(LidPivot);
|
||||
LidMesh->SetupAttachment(BaseMesh);
|
||||
LidMesh->SetCollisionProfileName(UCollisionProfile::NoCollision_ProfileName);
|
||||
|
||||
Storage = CreateDefaultSubobject<UInventoryComponent>(TEXT("Storage"));
|
||||
@@ -235,7 +234,7 @@ void AStorageContainer::Tick(float DeltaTime)
|
||||
|
||||
void AStorageContainer::ApplyLidRotation()
|
||||
{
|
||||
if (!LidPivot)
|
||||
if (!LidMesh)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -244,7 +243,7 @@ void AStorageContainer::ApplyLidRotation()
|
||||
// s'arrete d'un coup, ce qui se lit comme une saccade sur un objet lourd.
|
||||
const float Eased = FMath::SmoothStep(0.f, 1.f, LidAlpha);
|
||||
|
||||
LidPivot->SetRelativeRotation(OpenRotation * Eased);
|
||||
LidMesh->SetRelativeRotation(OpenRotation * Eased);
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
|
||||
Reference in New Issue
Block a user