can anyone what I'm going wrong as I'm new in unity error CS0165: Use of unassigned local variable 'diff'

Viewed 34
1 Answers

I believe this must be happening because you need a specific condition to set the diff variable. If that condition is not met, you're not setting it at all.

To fix try setting the diff variable to some value in the else statement on line 27.

Let me know if that works for you.

Vlad

Related