For some reason, my player is not colliding with the tilemap walls that have collision on them... Here is my player movement code
void Update()
{
hInput = Input.GetAxisRaw("Horizontal");
vInput = Input.GetAxisRaw("Vertical");
if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.RightArrow))
{
transform.Translate(hInput, 0, 0);
}
else if (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.DownArrow))
{
transform.Translate(0, vInput, 0);
}
}
When I move my player they go right through the colliders. They are on the same Layer and both have colliders. Anyone know why this is happening? Thanks!
Edit: So I've tested the collisions with OnCollisionEnter2d like suggested and they are colliding, the problem is my player still walks right through the wall. I have no clue why the collider doesn't stop this from happening.