Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Weird GUI problem

$
0
0
Hi. In my OnGUI funciton i am using a GUI.Button to move my character but i dont have to click on it and its mocing by himself... and also " Move " is written on the console every frame.I have been using this OnGUI function in other games and was working fine , i dont know what happend to unity but it is not working poperly.THANKS FOR THE HELP! #pragma strict public var skin : GUISkin; public var player1 : GameObject; function OnGUI() { GUI.skin = skin; if ( GUI.Button ( Rect ( 0 , 0 , 100 , 100 ) , " " ) ) ; { player1.rigidbody2D.velocity = Vector2 ( 0 , 10 ); Debug.Log( " Move " ) ; } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>