Correct way to replicate Event

,

I am struggling to Get my event to stop every time on my weapons this is what i have implemented.

Mouse pressed starts weapon fire and mouse released stops fire.

weapon executes Fire();
that contains PlayWeaponFireAudio();

function checks if IsLocallyControlled and sets event to 1P or 3P on result

i then only set instance and play if instance is not valid as its a looping event

if(!EventInstance.Instance->isValid())
		{
			EventInstance = UFMODBlueprintStatics::PlayEventAtLocation(GetWorld(), CurrentFireEvent, GetActorTransform(), true);
		}
		UFMODBlueprintStatics::EventInstanceSetTransform(EventInstance, GetActorTransform());

i then use the same function in the MutiFire();

then when mouse is released i execute StopLoopedWeaponFireAudio()

i stop it locally with

UFMODBlueprintStatics::EventInstanceStop(EventInstance, true);
	EventInstance.Instance = nullptr;

then run a server event that calls a multicast to stop the event with

UFMODBlueprintStatics::EventInstanceStop(EventInstance, true);
	EventInstance.Instance = nullptr;

can anyone see any issues with the way i am doing it?

EventInstance is replicated

void AProjectileWeapon::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);
	
	DOREPLIFETIME(AProjectileWeapon, EventInstance);
	
	
	
}

Hi,

What version of the FMOD integration are you using?

To stop an event you will need to call EventInstance::Stop() which may be missing from your EventInstanceStop(EventInstance, true); function. You can read more about the EventInstance functions here: FMOD Engine | Studio API Reference - EventInstance.

I am confused about how replicating an event is involved, could you elaborate a bit further if there is still an issue?

Hope this helps!