1. How do I get individual position co-ordinates in another function? In JavaScript it was as simple as passing something like player.transform.position and you could access the X co-ord with just .x appended to whatever name you gave your object. Tried that in C# and all I got for Xmas was a big fat error.

    My code is:

    Code:
    string type = "warning";
    string log = "Test string";
    object location = player.transform.position;EventLogger?.Call("AppendToLog", type, log, location);
    At the other end I have:

    Code:
    void AppendToLog(string type, string log, object location) {            Int32 NowTimestamp = GetTimestamp();            Puts("AppendToLog says: " + type + " | " + log + " | " + location + " | " + NowTimestamp);}
    This works, in thst it returns the full co-ords, but I want the individual co-ords rather than the formatted ones.

    Thanks in advance,


    T.
     
  2. Wulf

    Wulf Community Admin

    You'd need to cast that Object to Vector3 or pass it directly in order to be able to access x, y, z.
     
  3. Ahh, no idea what that means.

    But it gives me a new keyword to search for :) Vector3 - sounds like a terrible 1970's sports car.

    Cheers!
     
  4. Wulf

    Wulf Community Admin