Hello. This is driving me nuts, so I hope you can help me…
Ive tried to explain it as simple as possible, and i’ve commented every line on the script screenshots.
Right, so… I am making a 2D, top down game.
The scripts I post are for a supplybox and a aircraft(C130)
My idea is that the supplybox is invisible until the aircraft has flown over its position. Thats fine and working, but I want the aircraft to be Destroy()'ed afterwards, and heres where the problem is.
The aircraft should be destroyed when its x-units away from the player when it has passed the supplybox’s position(delivering the box).
So when the box has been changed to visible, it would change the “isDelivered” variable in the aircraft script, to true.
But I keep getting:
“Object reference not set to an instance of an object” at the line where it tries to change “isDelivered” to true.
I hope you guys can help…
I even tried making 2 new scripts and tried to change a variable in scriptB from scriptA.
It worked :x - So im really lost…

