|
Hey, I have been trying to get touch screen controls working for awhile now. But I just can't get it to work the way I want it to. I have one gui button at the moment to move to the right, but when I touch the button the cube only moves slightly and I have to keep pressing the button to move any further. Is there away to get this to move constantly when I touch down on the button and then stop when it's not touched? the only way I got this working was by using the here is my code after a few attempts
(comments are locked)
|
|
GUI.Button(new Rect(10,10,150,150),"RIGHT") only returns true when the button is first clicked. One possible solution would be to skip the OnGUI and make actual game objects the user can click. I'm doing this with a second camera showing a gui layer. In the Update() function your code, attached to the button gameobject, would look something like: I can't seem to get this script to work. I don't know if it's the fact the I am referencing something wrong, but what I have done now is created a GUI Text object and added that to the script. I also added it to the main camera so instead of guiCamera I have Camera.main but there is no movement what so ever.
May 15 '12 at 02:34 AM
Ranger_Steve
(comments are locked)
|
