- Home /
Question by
edgegaming · Aug 20, 2013 at 03:39 AM ·
Changing COG of Vehicle with button press
I am wanting to have two buttons to change my COG to move it forward and backward and left and right for a racing game how would i do this i tried but didnt really understand function OnMouseDown() { transform.Translate (0,0,1); } var btnTexture : Texture; function OnGUI() { if (!btnTexture) { Debug.LogError("Please assign a texture on the inspector"); return; } if (GUI.Button(Rect(10,10,50,50),btnTexture)) Debug.Log("Clicked the button with an image"); if (GUI.Button(Rect(10,70,50,30),"Click")) Debug.Log("Clicked the button with text"); }
Comment
Your answer