I have a vector3 created in one script that tells the location of the player, and a vector3
in another script that is supposed to receive it, but the receiver keeps showing up as 0,0,0.
Here is the sending script:
var pos : Vector3;
function Update () {
pos = transform.position = Vector3(0, 0, 0);
}
and here is the receiving script:
var player : GameObject;
var looking = false;
var ply : Vector3;
var x : float;
var z : float;
function Update() {
x = Random.Range(1, 30);
z = Random.Range(1, 30);
player.GetComponent(Playerpos).pos = ply;
ply + Vector3(x, 0, z);
if(looking == false){
transform.position = ply;
}
}
function HitByRaycast(source : GameObject) {
looking = true;
}
EDIT:
Benprodictions1: Since you don’t seem to be capable enough to format your code yourself, I did it for you!!!