diff --git a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
index 9af72f96..e297b877 100644
--- a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
+++ b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
@@ -9,6 +9,13 @@
+
+
+
+
+
+
+
@@ -30,28 +37,28 @@
- {
+ "keyToString": {
+ "C++ Project.EndlessVendetta.executor": "Run",
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "git-widget-placeholder": "attachment-bug-fix",
+ "ignore.virus.scanning.warn.message": "true",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "vue.rearranger.settings.migration": "true"
},
- "keyToStringList": {
- "rider.external.source.directories": [
- "C:\\Users\\mhara\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\DecompilerCache",
- "C:\\Users\\mhara\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\SourcesCache",
- "C:\\Users\\mhara\\AppData\\Local\\Symbols\\src"
+ "keyToStringList": {
+ "rider.external.source.directories": [
+ "C:\\Users\\mhara\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\DecompilerCache",
+ "C:\\Users\\mhara\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\SourcesCache",
+ "C:\\Users\\mhara\\AppData\\Local\\Symbols\\src"
]
}
-}]]>
+}
@@ -127,6 +134,9 @@
+
+
+
diff --git a/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset b/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset
index aa861853..37e39f6f 100644
--- a/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset
+++ b/EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e1a0785430701e8ad4da18841226e2e18dd72d825c6a10cf28e7d73f1216ed28
-size 9013
+oid sha256:8924c723b3b8eaf0a1a580f215de2a547d9118851c617ad590199910fa2f48c9
+size 9020
diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_ARTEST1.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_ARTEST1.uasset
index 8aa30a2f..f2ca1773 100644
--- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_ARTEST1.uasset
+++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_ARTEST1.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:5dd6f9f711da54c221a1be010a47ff7bb53d5f37f0afa26a30cfde85d9d8d8d9
-size 41696
+oid sha256:da280a53ff9a19fc5698a2e4e87a2f0b6e4fd81c95fb5929a659cdb507b0d446
+size 41581
diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset
index 23e228bc..201ac1f9 100644
--- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset
+++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:1e0ab8a1e0763724c9f778d26fc39f9e2ec80dc2a63cc99d23a4edf1d5ceb6c6
-size 126609
+oid sha256:f4d4c8728c6346fed52e60b7b56fa54a6492180815d2cee29d8d8730ac624947
+size 125545
diff --git a/EndlessVendetta/Content/StarterContent/Shapes/TempSilencer.uasset b/EndlessVendetta/Content/StarterContent/Shapes/TempSilencer.uasset
index fbc6d821..b857d8a4 100644
--- a/EndlessVendetta/Content/StarterContent/Shapes/TempSilencer.uasset
+++ b/EndlessVendetta/Content/StarterContent/Shapes/TempSilencer.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:61c0b03ac13ff095d5e52f5551a54cadb54e669e33e5a6a1ee4f8e4e233e50f2
-size 26923
+oid sha256:cb6b37e3900f88fd3a4a94643d255ddb765f6cacefc1b8adc92c5fb97e7393a8
+size 28238
diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/PG/AISD2CY0WTWKV1BJDYTYJ3.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/PG/AISD2CY0WTWKV1BJDYTYJ3.uasset
index b2990eba..11295e10 100644
--- a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/PG/AISD2CY0WTWKV1BJDYTYJ3.uasset
+++ b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/PG/AISD2CY0WTWKV1BJDYTYJ3.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:bb7fd3b17bbcc170b84fda39c7712b526f201a4a45ea48d1ac36415e0ca366ee
-size 7007
+oid sha256:4d53dac7e3e749916ed5e5802c3c3495f2895827dcb66e9b2f49a8cac9a4ecb5
+size 6664
diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp
index 891eabc8..0e458497 100644
--- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp
+++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp
@@ -258,19 +258,28 @@ void ABaseWeaponClass::InteractPrompt()
void ABaseWeaponClass::SetupSilencerAttachment(UStaticMesh* SilencerMesh)
{
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("SETTING UP SILENCER ATTACHMENTS"));
- FTransform emptytransform;
- UActorComponent* SilencerComponent = AddComponentByClass(USilencerAttachmentClass::StaticClass(), true, emptytransform, false);
- UStaticMeshComponent* SilencerMeshComponent = Cast(AddComponentByClass(UStaticMeshComponent::StaticClass(), true, emptytransform, false));
- SilencerMeshComponent->SetStaticMesh(SilencerMesh);
- SilencerMeshComponent->AttachToComponent(Cast(GetComponentByClass(USkeletalMeshComponent::StaticClass())), FAttachmentTransformRules::SnapToTargetIncludingScale, FName(TEXT("SilencerMeshSocket")));
- Cast(SilencerComponent)->AttachToComponent(SilencerMeshComponent, FAttachmentTransformRules::SnapToTargetIncludingScale);
- FTransform SilencerSocketTransform = SilencerMeshComponent->GetSocketTransform(FName(TEXT("SilencerMeshSocket")), RTS_Component);
- FRotator SilencerSocketRotation = SilencerMeshComponent->GetSocketRotation(FName(TEXT("SilencerMeshSocket")));
- SilencerMeshComponent->SetRelativeTransform(SilencerSocketTransform);
- SilencerMeshComponent->SetRelativeRotation(this->GetActorRotation());
+ FTransform EmptyTransform;
+ USceneComponent* SilencerAttachmentClass = Cast(AddComponentByClass(USilencerAttachmentClass::StaticClass(), false, EmptyTransform, false));
+ USkeletalMeshComponent* WeaponSkeletonMesh = FindComponentByClass();
+ if (IsValid(SilencerAttachmentClass))
+ {
+ if (IsValid(WeaponSkeletonMesh))
+ {
+ SilencerAttachmentClass->AttachToComponent(WeaponSkeletonMesh, FAttachmentTransformRules::SnapToTargetIncludingScale, FName(TEXT("SilencerSocketMesh")));
+ UE_LOG(LogTemp, Display, TEXT("All Attachment is valid"));
+ //this makes it showup in editor for better debugging
+ SilencerAttachmentClass->CreationMethod = EComponentCreationMethod::Instance;
+ SilencerAttachmentClass->RegisterComponent();
+ UStaticMeshComponent* StaticMeshComp = NewObject(SilencerAttachmentClass, UStaticMeshComponent::StaticClass());
+ if (IsValid(StaticMeshComp))
+ {
+ StaticMeshComp->AttachToComponent(SilencerAttachmentClass, FAttachmentTransformRules::SnapToTargetIncludingScale);
+ StaticMeshComp->SetStaticMesh(SilencerMesh);
+ StaticMeshComp->CreationMethod = EComponentCreationMethod::Instance;
+ StaticMeshComp->RegisterComponent();
+ }
+ }
+ }
}
-
-
-
\ No newline at end of file
diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.cpp b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.cpp
index 7f31f73b..50b63063 100644
--- a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.cpp
+++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.cpp
@@ -29,7 +29,5 @@ void USilencerAttachmentClass::BeginPlay()
void USilencerAttachmentClass::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
-
- // ...
}