here is my code but the gui button doesnt show up at all . Can anyone tell me what im doing wrong please. any help is appreciated
using UnityEngine;
using System.Collections;
public class JumpButton : MonoBehaviour {
public bool jump = false;
public float jumpForce = 1000f;
private bool grounded = false;
void OnGUI ()
{
if(GUI.Button(new Rect(400,400,80,20), "Jump"))
{
if((grounded == true))
{
jump = true;
grounded = false;
}
}
}
void FixedUpdate ()
{
if(jump == true)
{
rigidbody2D.AddForce(new Vector2(0f, jumpForce));
jump = false;
}
}
}