Little bit of help? 2.5D platformer problems

Hey so I’m New to unity and to start I chose to follow a tutorial on YouTube. ( this one ) Anyways I strayed a little bit from the tutorial not much really , basically the player is a cube in the tutorial… I used the same cube but chose not to render it (just use it as a bounding box for the player) instead I made a 3D plane made it a child of the player cube and also made the camera a child of the same cube. That way I could instead us a 2D sprite as my player object and have the camera follow the player. But! here is my problem. When ever I hit a wall even just a little bit, I can no longer jump. I’m only aloud to walk left to right jumping no longer works.

any help would be appreciated. thanks .

Did you make sure to add a physics material on your player collider with 0 friction, as well as setting its friction combine to minimum if your collider is a 3d collider?

Post your movement/jumping script (use code tags). If jumping works normally except when you are touching a wall there is probably some sort of check being done that disables the jump in certain conditions e.g. If the wall is tagged as a wall perhaps jump is disabled when the player is touching it to prevent wall/double jumping.

Also, did everything work before you changed things?

yes, it works the same even if I render the cube and do not attach the children.

its a bit sloppy :

using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour
{
//movement
public float speed;
public float jump;
float moveVelocity;

//Grounded Variables
bool grounded = true;

// Update is called once per frame
void Update ()
{
//jumping
if (Input.GetKeyDown(KeyCode.W))
{
if (grounded)
{
GetComponent<Rigidbody2D> ().velocity = new Vector2 (GetComponent<Rigidbody2D> ().velocity.x, jump);
}
}

moveVelocity = 0;
//left and right
if (Input.GetKey (KeyCode.A))
{
moveVelocity = speed;
}
if (Input.GetKey (KeyCode.D))
{
moveVelocity = -speed;
}

GetComponent<Rigidbody2D> ().velocity = new Vector2 (moveVelocity, GetComponent<Rigidbody2D> ().velocity.y);


}

// Check if grounded
void OnTriggerEnter2D()
{
grounded = true;
}

void OnTriggerExit2D()
{
grounded = false;
}


}




Put a breakpoint on the if(grounded) part of the jump & then see what the value is when you press the jump key. If jump is false you will need to work out why as you are only setting it to false when nothing is touching the collider.

Also, try putting the Sprite under the player & not the camera