Having an issue with the 2D Collision (Video 21 in 2D course)

hello all, having an issue that’s driving me nuts. I was working on the 2D course and for some reason when I try to use the PlayClipAtPoint it doesn’t work which causes my objects not to break, I have my sound effect dragged into my serialized field but all I get is a Null Reference Exception.

Images below for code, unity UI and error.

image

Thanks everyone!

Found this solution

Hi,

Welcome to our community! :slight_smile:

NullReferenceException means that a reference (“link”) to an instance is missing. Double click on the error message to see to which line in your code it is referring. If you exposed a field in the Inspector, make sure that it’s not empty.

Did this help or have you already found a solution?


See also:

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

Privacy & Terms