I followed the Unity Cookie A* RTS tutorial which looks similar to the very basic “getting started” tutorial found in the official docs. However, I am getting the following exception:
NullReferenceException: CharacterController.SimpleMove(Vector3.speed)
Here is the code in question
`// Find direction to next waypoint.
Vector3 dir = (_path.vectorPath[_currentWaypoint] - transform.position).normalized;
dir *= _speed * Time.fixedDeltaTime;
//MOVE!
_controller.SimpleMove(dir);`
I noticed that the very first waypoint generated is sitting directly at the location of my character’s transform.position, meaning that currentWaypoint - transform.position == 0,0,0 which of course cannot be scaled by the speed factor.
Why is the first waypoint sitting on top of my character’s starting position?