Pick-up SFX only playing in one ear

Ok, I have found a solution… kind of. I recreated the prefab and attached the DataPickup script. I have changed the script to this:

public class DataPickup : MonoBehaviour

{

    [SerializeField] AudioClip pickupSFX;

    void OnTriggerEnter2D(Collider2D other) {

        if (other.tag == "Player") {

            AudioSource.PlayClipAtPoint(pickupSFX, transform.position, 1.0f);

            Destroy(gameObject);

            ScoreManager.instance.AddPoint();

        }    

    }

}

The only problem is that the pickupSFX is very quiet, even though the volume in both the script & the AudioSource component is set to 1. Maybe we can figure out the solution to that. I assume it’s because of the transform.position but I don’t know the solution to that.

Prefabs do not exist in the scene, thus they cannot play any sounds and cannot emit any particles with the particle systems. Maybe that is/was the problem?

Yes, that’s very likely the reason. Test Camera.main.transform.position.

Camera.main.transform.position leads to the sfx playing in one ear.

Then try to pass on 5.0f instead of 1.0f. Maybe that’ll work.

Otherwise, I can only repeat my initial suggestion.

Also please feel free to ask our helpful community of students for further ideas over on our Discord chat server.

Not sure if this could be helpful, but in the RPG course Sam or Rick told their students that they could move the audio listener from the camera to a child Game Object under the camera and then move the game object closer to the Player. That is another way to increase the volume.

1 Like

Unfortunately, this doesn’t work Nina. I’ll try to look for more suggestions.

Thanks dude. The problem of the SFX playing in one ear is solved. The only issue now is the volume for the collectibles, which is very low. Do you know a solution to that? Thanks again for the help.

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

Privacy & Terms