I would like to get some developer set information from a GameObject I have a reference for. For example to get the tag or instanceId is simple if object is in variarable otherObject
(note the code below is JavaScript but I program in Boo so there may be lots syntax errors but the logic should be right)
xTag = otherObject.tag;
xID = otherObject.instanceID();
I have many attribute so I don’t want to use Tag.
curently I am doing a callback with SendMessage but this pretty messy. in first object script
otherObject.SendMessage("informMe",transform);
in otherObject script
function informMe(sender){
sender.SendMessage("SetOrigin",origin);
}
back in first object
function SetOrigin(value){
origin = value;
}
all this to get origin from otherObject.it is not very clear code and tough to follow since the execution thread goes back and forth between files alot.
I was hoping to get a return vale from the other objectScript
xOrigin= otherobject. ... .getOrigin();
in other object
function GetOrigin(){
return origin;
}
“…” could be various functions some how getting the a script from otherObject and then the function getorigin and executing it and getting the retun value back.
Cheers,
Grant