- Home /
Access Joystick script
I have GameObject "Player" with attached scripts "Player" and "Joystick" (last - from the Standard mobile assets):
When I try to access Joystick from my code:
Joystick joystick = GetComponent<Joystick> ();
it says, that:
Assets/Scripts/Player.cs(10,17): error CS0246: The type or namespace name `Joystick' could not be found. Are you missing a using directive or an assembly reference?
How can I access it?
screen shot 2012-07-13 at 14.43.56.png
(25.4 kB)
Comment
Answer by JustinReinhart · May 03, 2013 at 06:18 AM
It looks like you are using a C# class to access a Javascript class which doesn't appear to be possible. (Unity 3.5)
Instead, you may be interested in the Joystick.cs available in the wiki: http://wiki.unity3d.com/index.php?title=Joystick