Storing Static String into new String variable

I have some ship names defined in my Controller.js script that I’d like to access from other scripts. So in my Controller script I have, for example

static var ship1 : String="Bounty";

In my other script I can use

print ("Ship is "+Controller.ship1);

or print it to my GUI window and it will print “Ship is Bounty” as required.
But how can I store this String into another String variable, like so…

var newShip : String;

so I can use i.e

newShip=Controller.ship1;
print ("Ship is "+newShip);

resulting in “Ship is Bounty”.
As it is it remains blank .e “Ship is …”
Appreciate any help on Strings, it’s an area I’ve neglected and now I really need them.

Only one answer and that was spam :frowning:

Anyone have advice on this ? Is it possible to store the Static string into a newer variable, or is there a more refined way to go about this ?

Just create a new string var and do something along the lines of…

var myString : string;

function Awake() {
myString = CLASSNAMEOFSHIP.ship1;
}

With class name being the name of the class that contains the static string. Though you probably guessed that. :stuck_out_tongue: