- Home /
trouble setting map boundaries of top down 2d shooter
I am creating my first unity game which is a 2d top down shooter.
I am very happy with how my player is moving around the map but I am having trouble setting up boundaries around the map.
I am moving the player by using the rigidbody2D.MovePosition method.
I have added a rigidbody2D to my player and I have added tiles around the outside of the map also with rigidbody2D added to them. their z axis matches the z axis of the player. I assumed that when these rigid bodies collided the player would not be able to move further in that direction, but he continues to move straight through them.
Am I trying to go about this the right way or is there a better way to set up boundaries?
Thanks in advance.
Answer by Greek_Soldier · Mar 14, 2015 at 03:43 PM
Are you sure that you have a collider on your objects? In the 2d physics system the rigidbody doesn't work as a collider.