Quantcast
Channel: Answers by "IvovdMarel"
Viewing all articles
Browse latest Browse all 145

Answer by IvovdMarel

$
0
0
The error will no longer pop up, and your code will compile, but it definitely does not fix the problem. You're basically telling the program to 'try' and run this code, but if there is any error you will 'catch' it yourself. Generally in the catch statement you would put a Debug.LogError or Debug.LogWarning to ensure you're aware this situation is still happening. If you get a null reference you have to find out why it is null - in this case, it must be somewhere in your PushPullObjectDetection function. If you don't do this, later on, unexpected things will happen (the game might not work as expected, you get no errors, it's almost impossible to find out what's causing it).

Viewing all articles
Browse latest Browse all 145

Trending Articles