I’m trying to write a bit of code that send coordinates of one object to another script, but I’m getting a NullReferenceException.
The first script, Movement Point, has this:
var move : MovementScript = GetComponent(MovementScript); //x and y are established as the coordinates move.getMovementPosition(x, z);
The second script, MovementScript, has this:
function getMovementPosition(x : float, z : float) { //moves the player }
Both scripts have been attached to appropriate objects. Could anyone please offer a possible explanation for what is going wrong here?