Hi, cheers for reading;
-Two classes: Map_Mech & Map_Tile_Generic
-There is one object that contains the script Map_Mech, that object is called pMap_Mech (prefab)
-There are potentially hundreds of clones of the prefab (pTile) that contains the Map_Tile_Generic script. I want the Map_Tile_Generic script to take a value from the single Map_Mech, and use it (accessor functions). I have drag/dropped the Map_Mech prefab into the script area in the pTile prefab, and it finds it (other.getTileScale()
) sets to the correct value, as its only assigned once, on create)
Map_Mech:
public Vector3 GetNewVector () { return vNewVector; }
“Map_Tile_Generic”
private GameObject oBase;
public Map_Mech other;
void Awake()
{
oBase = GameObject.CreatePrimitive (PrimitiveType.Cube);
oBase.transform.position = other.vNewVector;
oBase.transform.localScale = other.GetTileScale();
}
Map_Mech changes the value of vNewVector in real time, however, when I use the function, it always returns Vector3(0,0,0); I managed to solve my previous question after posting, so I’m hoping I can do the same XD However, if anyone does know (or has an idea), the info would be fantastic! I’m online every day between 10am-10pm GMT (usually). Ta