Hi! I’m trying to update the position of an FMOD event instance so the sound follows along when my actor is moving. But when I use “set3DAttributes” the event doesn’t sound anymore at all. I’m not getting any error from either get or set. I’ve tried printing out my actor location and compare it with the updated position from get3DAttribures and they are identical. What am I missing?
// ==== Header ====
FFMODEventInstance MovingSfxInstance;
// ==== Source ====
FMOD_3D_ATTRIBUTES Fmod3dAttributes;
FMOD_RESULT result = MovingSfxInstance.Instance->get3DAttributes(&Fmod3dAttributes);
if (result != FMOD_OK)
{
Helper::Log("FMOD ERROR:", result);
}
Fmod3dAttributes.position = FmodManager::ConvertToFmod(NewLocation);
FMOD_RESULT setResult = MovingSfxInstance.Instance->set3DAttributes(&Fmod3dAttributes);
if (setResult != FMOD_OK)
{
Helper::Log("setResult:", setResult);
}
// ==== Helper function ====
FMOD_VECTOR FmodManager::ConvertToFmod(FVector Vector)
{
FMOD_VECTOR FmodVector;
FmodVector.x = Vector.X;
FmodVector.y = Vector.Y;
FmodVector.z = Vector.Z;
return FmodVector;
}