Instantiate Single Joystick in C# code

Hi All

I am simply trying to instantiate the Single joystick prefab from the standard Assets (Mobile) library in a script. The reason for this is so I can make my User Interface device independent by setting its initial size, location and other variables to be a % of the device’s screen size.

I’m sure it should be simple but I can’t find any working reference code for instantiating it, I get the impression I can make a GameObject variable to hold it but I am missing the rest.

Cheers in advance (Newbi Unity user) Sevo

I knew the forums would get spammed -.- Unity needs to hire 5 new mods for the forums and answers! :frowning:

btw since this is a question, questions goes to Unity Answers…

I’m feeling generous today here’s what you’re looking for :wink:

GameObject joy = Instantiate(object,pos,rot); //or GameObject joy = new Instantiate(object,pos,rot);
joy.changeSomeThingsHere;

not tested but should work!

Thanks for the reply, Did I post in the wrong forum ?, I’m developing for Android, or should I post in the scripting forum?

Cheers again

Sevo

No forums are for discussions :wink: Check this out : http://answers.unity3d.com/index.html