Source/TacticalVRCore/Private/Weapon/Attachments/TVRWeaponAttachment.cpp
void ATVRWeaponAttachment::BeginPlay()
{
	Super::BeginPlay();

	TArray<UStaticMeshComponent*> Meshes;
	GetComponents<UStaticMeshComponent>(Meshes);
	for(UStaticMeshComponent* TestMesh: Meshes)
	{
		if(TestMesh->GetCollisionProfileName() == FName("Weapon"))
		{
			AttachmentMeshes.AddUnique(TestMesh);
		}
	}
	
	GetWorldTimerManager().SetTimerForNextTick(this, &ATVRWeaponAttachment::FindAttachPointAndAttach);
}
// Called when the game starts or when spawned
Called when the game starts or when spawned
Called when the game starts or when spawned
void ATVRWeaponAttachment::BeginPlay()
{
	Super::BeginPlay();
	TArray<UStaticMeshComponent*> Meshes;
	GetComponents<UStaticMeshComponent>(Meshes);
	for(UStaticMeshComponent* TestMesh: Meshes)
	{
		if(TestMesh->GetCollisionProfileName() == FName("Weapon"))
		{
			AttachmentMeshes.AddUnique(TestMesh);
		}
	}
	GetWorldTimerManager().SetTimerForNextTick(this, &ATVRWeaponAttachment::FindAttachPointAndAttach);
}
void ATVRWeaponAttachment :: BeginPlay ( ) { Super :: BeginPlay ( ) ; TArray < UStaticMeshComponent * > Meshes ; GetComponents < UStaticMeshComponent > ( Meshes ) ; for ( UStaticMeshComponent * TestMesh : Meshes ) { if ( TestMesh -> GetCollisionProfileName ( ) == FName ( " " ) ) { AttachmentMeshes . AddUnique ( TestMesh ) ; } } GetWorldTimerManager ( ) . SetTimerForNextTick ( this , & ATVRWeaponAttachment :: FindAttachPointAndAttach ) ; }
Called when the game starts or when spawned
Called when the game starts or when spawned