My weapons are components. Im trying to play sounds on them and am having issues.
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Weapon|Sounds)
UAudioComponent* FiringAudioComponent = nullptr;
FiringAudioComponent = UGameplayStatics::SpawnSoundAttached(FiringSound,this,NAME_None,FVector::ZeroVector,EAttachLocation::KeepRelativeOffset,true );
iv tried spawning a component with create defult sub object in constructor. iv tried it with new object in begin play. and iv tried the abouve.
instead of this iv treid GetOwner()->GetrootComponent()
And I keep geting the same error.
Ensure condition failed: false [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp] [Line: 2104]
Template Mismatch during attachment. Attaching instanced component to template component. Parent ‘Default__BP_TestMinigun_C’ (Owner ‘None’) Self ‘FiringAudioComponent’ (Owner ‘BP_Ship2_C_UAID_BCFCE76666E6B77202_1877761088’).
[2025.07.05-21.04.29:132][ 0]LogOutputDevice: Error: Ensure condition failed: false [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp] [Line: 2104]
Template Mismatch during attachment. Attaching instanced component to template component. Parent ‘Default__BP_TestMinigun_C’ (Owner ‘None’) Self ‘FiringAudioComponent’ (Owner ‘BP_Ship2_C_UAID_BCFCE76666E6B77202_1877761088’).
[2025.07.05-21.04.29:132][ 0]LogStats: FDebug::EnsureFailed - 0.000 s
A breakpoint instruction (__debugbreak() statement or a similar call) was executed in UnrealEditor.exe.
Anny Assistance?