My player is supposed to make a bump sound as soon as it hits a wall. Instead it does it about a second after it hits the wall. I have two things in my scene checking if the player hits the wall, an OnCollisionEnter2D in the player controller script, and an OverlapCircle in a script attached to the player’s child object.
The OverlapCircle is bigger than the player’s CircleCollider, but the OnCollisionEnter2D almost always goes off before the OverlapCircle detects the wall (I’ve seen the OverlapCircle detect the wall first a single time).
The player’s animations don’t affect its collisions at all and neither does its nose.
Here is a gif of this happening: (wall1 = OverlapCircle, wall2 = player collision)

Player collider:
OverlapCircle on the player’s child object:
Hierarchy:
Code from the player controller:
> private void OnCollisionEnter2D(Collision2D collision) {
> if(collision.gameObject.CompareTag("Wall")) {
> soundManager.PlayClip(soundManager.WallBump, transform, 1);
> Debug.Log("wall2");
> }
> }
Code from the player’s child object:
> void FixedUpdate() {
> touchingWall = Physics2D.OverlapCircle(transform.position, 1.05f, layerMask);
> if(touchingWall && !touchedWall) {
> soundManager.PlayClip(soundManager.WallBump, transform, 1);
> Debug.Log("wall1");
> touchedWall = true;
> }
> if(!touchingWall) {
> touchedWall = false;
> }
> }
The SoundManager parts don’t matter, if I remove them it’s still delayed. I’ve also tried using a raycast, a second CircleCollider and OnTriggerEnter2D on the child object, a giant BoxCollider on the player, changing the physics timestep to make FixedUpdate go faster, and changing the child object’s code to use Update instead of FixedUpdate.
The player and the wall both have Rigidbody 2Ds with their collision detection set to continuous, and the player’s child object did too when I tried using a collider on it.
The debug messages are delayed, the problem has nothing to do with the sound, the sound just happens to be what’s supposed to happen when the player hits the wall.

