He hecho un script de el comportamiento del jugador y me esta dando muchos problemas.El jugador se pega a las paredes, da doble salto a veces porque si, y en ciertas zonas no se puede ni mover ni saltar podrían arreglarlo?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerBehaviour : MonoBehaviour {
private Rigidbody rigidbody;
public Vector2 jumpForce = new Vector2 (0, 400);
public float maxspeed = 3.0f;
public float speed = 50.0f;
private float xMove;
private bool canJump;
private bool onTheground;
private float yPrevious;
private bool collidingWall;
public const int maxHealth = 100;
public int currentHealth = maxHealth;
void Start () {
rigidbody = GetComponent<Rigidbody> ();
canJump = false;
xMove = 0.0f;
onTheground = false;
yPrevious = Mathf.Floor (transform.position.y);
collidingWall = false;
}
void Update () {
CheckOnTheGround ();
Jumping ();
}
void FixedUpdate(){
Movement ();
Camera.main.transform.position = new Vector3(
this.transform.position.x,
this.transform.position.y,
Camera.main.transform.position