I have been working away on the following script for some time and have managed to get it down to only one error…
" transform is not a member of Object "
the error occurs at var gameObjPos = go.transform.position;
any help would be really appreciated…
here’s a stripped down ver. of the code…
var orbSpot : Texture;
var playerPos: Transform;
private var radarHeight = 100;
private var deltay : float;
function OnGUI (){
GUI.BeginGroup(Rect (10,Screen.height-radarHeight - 10,radarWidth,radarHeight));
GUI.Box (Rect (0,0, radarWidth,radarHeight),"Radar");
DrawSpotsForOrbs();
GUI.EndGroup();
}
function DrawRadarBlip(go, spotTexture){
var gameObjPos = go.transform.position;
// lots of code in here .....
//
function DrawSpotsForOrbs(){
var gos : GameObject[];
// look for all objects with a TAG "orb"
gos = GameObject.FindGameObjectsWithTag("orb");
var Distance = Mathf.Infinity;
var Position = transform.position;
for (var go : GameObject in gos)
{
DrawRadarBlip(go,orbSpot);
}
}