I am making a 2d platformer and I don't know why this code is giving me
Invalid expression term '>' [51, 27]
public class controls : MonoBehaviour
{
public float speed;
public float jumpforce;
private float moveinput;
public Rigidbody2D rb;
private bool facingright = true;
private bool isgrounded;
public Transform groundcheck;
public float checkradius;
public LayerMask whatisground;
private int Jumps;
public int JumpsValue;
private float jumpinput;
void start()
{
rb = GetComponent();
Jumps = JumpsValue;
}
void FixedUpdate()
{
jumpinput = Input.GetAxis("Vertical");
moveinput = Input.GetAxis("Horizontal");
rb.velocity = new Vector2 (moveinput * speed, rb.velocity.y);
if (facingright == false && moveinput > 0)
{
flip();
}
else if (facingright == true && moveinput < 0)
{
flip();
}
isgrounded = Physics2D.OverlapCircle(groundcheck.position, checkradius, whatisground);
}
void update()
{
if (isgrounded == true)
{
Jumps = JumpsValue;
}
if (jumpinput == > 0 && Jumps > 0)
{
Debug.Log("WHY AREN'T YOU JUMPING FUCKER");
rb.velocity = Vector2.up * jumpforce;
Jumps--;
}
}
void flip()
{
facingright = !facingright;
Vector3 Scaler = transform.localScale;
Scaler.x *= -1;
transform.localScale = Scaler;
}
}
↧