Grab It script has error. "Check if it is null"

Hi I have a script from the asset store called Grab It. It works how I want it to, except one issue. Any time you are holding an object and it gets destroyed it will tell an error, and won’t allow me to grab any more items. This is the debug info :
MissingReferenceException: The object of type ‘Rigidbody’ has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
Lightbug.GrabIt.GrabIt.Update () (at Assets/AssetStore/GrabIt/Core/Scripts/GrabIt.cs:103)

I either need it to delete another item like a gun with it so it shows people they need to restart the level, or check if it is null. Any help Please? Thanks.

Update
I have figured it out, and took the script down due to full script being shown, and the script is from the Unity Asset Store.

Redo your code in code tags. Way to long of a script for people to go through and figure out what line number is what.

1 Like

Sorry @Brathnann but my problem is I do not know were to put the null script I looked and cannot find were it needs to go.

Which line is 103? Also, technically you should not re-publish code from the Asset Store without permission from the author.

Easy, before line 103.

Nevermind Sorry to bother you, figured it out. Just had to add a setactive (false) code ate about 4 different spots. Thanks anyway.

Oh! I did not know that @kdgalla . Is there a way I can take this post down? don’t want to keep something up that is not suppose to be up.

I don’t think you can remove the post, but there should be a link to edit it.

1 Like

Thanks @kdgalla found the edit and changed that.