I can not get sound to work

I am using UE5 and in the Sound lesson I set the the hit and launch sound to the bp_projectil also I set the death sound to both bp_pawntank and bp_pawnturret

In code I declared the wrote the code exactly like in the lesson for example

Projectil.h

UPROPERTY(EditAnywhere, Category="combat")
USoundBase* HitSound;

and Projectil.cpp beginplay

if (LaunchSound)
	{
		UGameplayStatics::PlaySoundAtLocation(this, LaunchSound, GetActorLocation());	
	}

But no sound at all. Any advise ?

Have you tried adding a log within the if statement to see if it’s being executed?

1 Like

I took the easy way and I set a breakpoint in rider, proectil BeginPlay and the breakpoint was not reached !!. I suspecting I am using different copy so I opened the toon tanks in UE5 then I open the project from menu Tools->Rider and found the project is correct.

Here is also a picture from rider that the sound was set in blueprints

any ideas to febug this ?

Sorry I used play in rider instead of debug. When projectil fire the if statement evaluate to true and also execute

PlaySoundAtLocation

but no sound to be heard

as a test I opened the FPS demo in U5 and the sound work fine so it is related to the project I have but no idea where is the problem ?

I found something new today: if I press play or debug in rider and it load the UE5 editor I can play with sound but if I open the UE5 editor separately (while rider opened) by opening the UE5 then browse to the project then run there is no sound

What causing this ?

Fixed with these steps:

> 1-Delete the folder Intermediate
> 2-Right click the uproject file and select generate vs files
> 3-open rider and choose for ex development editor build
> 4-wait until rider update source files
> 5-build from rider 
> 6-open UE5 editor and run and sound work as expected.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms