It says somethings wrong in line 19,41,52,2 and i can figure it out. Much thanks in advance.
Here is the code pls help.
using UnityEngine;
using System.Collections;
public class Player1 : MonoBehaviour
{
bool jump = false;
public float speed = 5f;
private float movement = 0f;
private Rigidbody2D rigidBody;
public float jumpSpeed = 8f;
// Use this for initialization
void Start()
{
rigidBody = GetComponent<Rigidbody2D>();
// Update is called once per frame
void Update()
{
if (input.GetButtondown("Jump"))
}
jump = true;
{
movement = Input.GetAxis("Horizontal");
if (movement > 0f)
{
rigidBody.velocity = new Vector2(movement * speed, rigidBody.velocity.y);
}
else if (movement < 0f)
{
rigidBody.velocity = new Vector2(movement * speed, rigidBody.velocity.y);
}
else
{
rigidBody.velocity = new Vector2(0, rigidBody.velocity.y);
}
movement = Input.GetAxis("Horizontal");
if (movement > 0f)
{
rigidBody.velocity = new Vector2(movement * speed, rigidBody.velocity.y);
}
else if (movement < 0f)
{
rigidBody.velocity = new Vector2(movement * speed, rigidBody.velocity.y);
}
else
{
rigidBody.velocity = new Vector2(0, rigidBody.velocity.y);
}
}