- Home /
The name 'Joystick' does not denote a valid type ('not found')
Hello and good day to all !
I am following a unity tutorial for iOS (http://www.raywenderlich.com/25349/how-to-get-started-with-unity-part-23), and I reach at the part where I need to implement the joystick and need to assign the joysticks to actually move and rotate the player.
I insert these two lines and it throws the aforementioned error, which I suggestively enter in title :)
var moveJoystick : Joystick;
var rotateJoystick : Joystick;
Can anyone please help ?
Thanks in advance, Dan.
I don't know what tutorial you're following, but Unity doesn't have a Joystick class (and since it doesn't exist, it's not a valid type).
Answer by raycosantana · Mar 04, 2014 at 01:00 PM
The simplest solution is to put the Joystick class inside the "Assets/plugins" folder (If you don't have one create it), now you can call Joystick class from any script.
Answer by Demigiant · Feb 20, 2014 at 09:51 AM
In that tutorial, Joystick is an external class you need to import (see the beginning of the chapter "Double the Joysticks, Double the Fun"). Once you do that, you won't get that error anymore :)
Almost. Just had to eventually drag the script within the Joystick.js script "folder"