wanting instance a variable of other script file??

Hello guys,

i’ve some script. and ai wanna instance some variable of other script.

i’ve a game controller with a script called 'gamecontroller.cs

and i’ve too a prefab called asteroid with has a script called mover.cs

i want instance a variable called ‘speed’ at mover.cs in gamecontroller.cs

i did someting like:

public Mover mover

and try call mover.speed. but doesn’t work. someone could help me :frowning:

Be sure the speed variable on Mover is public as well, or has appropriate getter/setter methods.

If you would to be able to access it without creating a Mover instance, make it static.