On line 6, you have private Player player, then line 10, you have player.gameObject.GetComponentsInParent<Player>();, but why? You are linking Player (which I assume is NOT another script), and trying to get the component of something that (most likely) doesnt exist on… Itself? What are you trying to look for with line 10 exactly? What component specifically? Unless “Player” is a script, there is no Unity component named “Player”.
Line 16, I think your if statement is backwards, it should probably be if(col.transform = player) assuming your “player” is a Transform
You should never call “Start”, the purpose of it is to just run only once, ever in your script, being the “entry function” or the very first function thats fired up, executed, and then never messed with again - create another function to do that and call that instead, and since its one line of code, its probably better to just use Line 10 in replacement of Line 17, unless you plan on making it much longer later?
I think the biggest issue is how you created “player” as a reference to “Player”, that it just doesnt know what your talking about. What exactly is “Player” and where does it exist?
@Dibbie can you look at my question I think you would be able to help. I posted it about 40 minutes ago. Here is a link. It is also in the null reference exception section. Thanks! http://answers.unity3d.com/questions/1203688/null-reference-exception-with-custom-class-object.html
– Kionte