Simple string variable

…so basically what I want to achieve is this: have a number of triggers along a path each with its own custom message, editable in the inspector.

code goes:

function OnTriggerEnter (collision : Collider) {
if (collision.gameObject.tag == "Player");
    MessageList.Instance().AddMessage("MISSION MESSAGE");
}

not sure how to do this but maybe with a variable like :

var someString : String

and then

MessageList.Instance().AddMessage.someString;

but that gives me an error:

‘someString’ is not a member of
‘function(String): void’.

I am doing something wrong, am I not? :slight_smile:

1 Answer

1

Try MessageList.Instance().AddMessage(someString);

Thank you!