Can't use AddExplosionForce in onCollisionEnter

//

For one thing, this (onCollisionEnter) is definitely an incorrect function name spelling. Refer to the documentation for the specific function you want for how to spell it. Capitalization and argument types also count 100%.

Which leads next to the question, “Is the collision handler code even being called?” Put a Debug.Log() in and find out.

How to report problems productively in the Unity3D forums:

http://plbm.com/?p=220

Help us to help you.

2 Likes

That’s a nice link, i think it’ll save me a lot of time helping others in the future as well haha. A bit off topic, but thanks :slight_smile:

Thanks Yoreki! I started gathering and writing such a gaggle of links a few months back, smartest thing I ever did I think, since 90% of questions in here have been asked ten zillion times. Feel free to link any of my goodies, or suggest more such links.

Here’s the main most-relevant ones, and I have more specific ones too, all queued up. Got a few of them from a few regulars in here like PraetorBlue and Uncle Joe-Censored.

Please use code tags: https://discussions.unity.com/t/481379

How to report problems productively in the Unity3D forums:

http://plbm.com/?p=220

Help us to help you.

Some notes on how to fix a NullReferenceException error in Unity3D

  • also known as: Unassigned Reference Exception
  • also known as: Missing Reference Exception

http://plbm.com/?p=221

The basic steps outlined above are:

  • Identify what is null
  • Identify why it is null
  • Fix that.

Expect to see this error a LOT. It’s easily the most common thing to do when working. Learn how to fix it rapidly. It’s easy. See the above link for more tips.

Here are some notes on IndexOutOfRangeException and ArgumentOutOfRangeException:

http://plbm.com/?p=236

Some help to fix “Cannot implicitly convert type ‘Xxxxx’ into ‘Yyyy’:”

http://plbm.com/?p=263

How to break down hairy lines of code:

http://plbm.com/?p=248

Here is some timing diagram help:

https://docs.unity3d.com/Manual/ExecutionOrder.html

This may help you with intellisense problems:

https://discussions.unity.com/t/778503

2 Likes