Hey guys,
so I’m trying to build a Tower which spawns 3 “bears” and calls the function MoveToLocation in the BearScript.
The BearScript is attached to the bear prefab but if I start the “game” I get the error: Object reference not set to an instance of the Object.
I already looked it up in the internet and did everything which was described there but still it doesnt work.
Pls help me 
BearScript: http://pastebin.com/2CCdDqqf
BearSpawnScript: http://pastebin.com/7BmnhJ9U
Regarts
Prie
and that error tells you which script and which line number… which are?
did you set any waypoints in the inspector?
Oh sorry.
The error appears in line 20 of the BearSpawnScript.
And as you can see set the waypoints in my inspector:
http://www.bilder-upload.eu/show.php?file=328b1e-1434643788.png
Do you have the variable “myWayPoint” initialized by anything? The error seems to be that “myWayPoint” is null when the script is run, at least for one frame.
Well I changed my script but still it’s not working…
I really don’t get it.
Does somebody have an idea for a workaround?
Script attachted to an empty GameObject: http://pastebin.com/E7zGvCXG
Script attachted to the bearObject: http://pastebin.com/qT9ajGGC
As you can see the waypoints are in a list in the spawnerscript… and I guess they are inizialized when the script runs…
So I tested a bit and found out that that the error occurs through the waypoints.