No audio on Ball using Array

Hi

I’m having an issue with no audio playing on collision of the ball to objects. I continued on in the lecture and am hearing the bounce audio for destroying a block, which leads me to think that it’s either an issue in my C# script or in my ball settings.

I’ve included screen shots of the settings and of the script.



Thank you so much!

Hi,

You’ve spelled Collision incorrectly, as such you don’t have a receiving method for the collision event.

Rename your OnCollisonEnter2D method to OnCollisionEnter2D.

Please note, it’s better to copy/paste your code and apply the code fencing characters, rather than using screenshots. Screenshots are ideal for displaying specific details from within a game engine editor or even error messages, but for code, they tend to be less readable, especially on mobile devices which can require extensive zooming and scrolling.

You also prevent those that may offer to help you the ability to copy/paste part of your code back to you with suggestions and/or corrections, meaning that they would need to type a potentially lengthy response. You will often find that people are more likely to respond to your questions if you make it as easy as possible for them to do so.

Hope this helps :slight_smile:


See also;

Thank you for you looking, and for the feedback on how to make it easier for people to help me.

1 Like

You’re very welcome Donald :slight_smile:

Has this resolved the issue for you now by the way?

It has. I also connected Visual Studio to Unity, which was not autocompleting and might have helped out there. :slight_smile:

1 Like

Hi Donald,

Great to hear, I’m pleased you can move forward with the course again :slight_smile:

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

Privacy & Terms