Fixed Silencer for Rifles not positioned and rotated properly

This commit is contained in:
MH261677 2024-02-01 15:49:52 +00:00
parent 9329454318
commit cec0b54b1a
5 changed files with 11 additions and 11 deletions

View File

@ -9,13 +9,10 @@
<component name="ChangeListManager">
<list default="true" id="8acc2658-cb31-4c49-857f-282cfee74640" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/FPWeapon/Mesh/SK_FPGun.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/FPWeapon/Mesh/SK_FPGun.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_ARTEST1.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_ARTEST1.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/StarterContent/Shapes/TempSilencer.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/Shapes/TempSilencer.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/__ExternalActors__/Levels/DoorTestLevel/9/PG/AISD2CY0WTWKV1BJDYTYJ3.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/__ExternalActors__/Levels/DoorTestLevel/9/PG/AISD2CY0WTWKV1BJDYTYJ3.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/Workbench&amp;Attachments/SilencerAttachmentClass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/Workbench&amp;Attachments/SilencerAttachmentClass.cpp" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -136,7 +133,7 @@
<workItem from="1706110241756" duration="1092000" />
<workItem from="1706705451486" duration="5218000" />
<workItem from="1706727398145" duration="597000" />
<workItem from="1706790490396" duration="6139000" />
<workItem from="1706790490396" duration="10304000" />
</task>
<servers />
</component>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -266,7 +266,7 @@ void ABaseWeaponClass::SetupSilencerAttachment(UStaticMesh* SilencerMesh)
{
if (IsValid(WeaponSkeletonMesh))
{
SilencerAttachmentClass->AttachToComponent(WeaponSkeletonMesh, FAttachmentTransformRules::SnapToTargetIncludingScale, FName(TEXT("SilencerSocketMesh")));
SilencerAttachmentClass->AttachToComponent(WeaponSkeletonMesh, FAttachmentTransformRules::SnapToTargetIncludingScale, FName(TEXT("SilencerMeshSocket")));
UE_LOG(LogTemp, Display, TEXT("All Attachment is valid"));
//this makes it showup in editor for better debugging
SilencerAttachmentClass->CreationMethod = EComponentCreationMethod::Instance;
@ -276,6 +276,9 @@ void ABaseWeaponClass::SetupSilencerAttachment(UStaticMesh* SilencerMesh)
{
StaticMeshComp->AttachToComponent(SilencerAttachmentClass, FAttachmentTransformRules::SnapToTargetIncludingScale);
StaticMeshComp->SetStaticMesh(SilencerMesh);
StaticMeshComp->SetRelativeRotation(FRotator(0,90,0));
StaticMeshComp->SetCollisionEnabled(ECollisionEnabled::NoCollision);
//Making it show in editor for debugging
StaticMeshComp->CreationMethod = EComponentCreationMethod::Instance;
StaticMeshComp->RegisterComponent();
}