- Home /
rigidbody to my player and a box collider to my background not working
Okay, I'm making a top-down game, where you have my player and the top down view background. I added a box collider on my player and a box collider on my background, I then added four cubes on each side on the background and took out the Mesh renderer, so it would look transparent. afterwards I added a rigidbody 2D on my player. Once done, I clicked play and my player just goes out of the background and starts acting weird, like in the inspector, the transform position and rotation for my player goes to: (on the "X" position) 0.02 and (on the "Y" position)-5.165049 (on the "Z" rotation) 0.3514884. And continues to change when I move the player. Please help!!!
if you are using a rigidbody2D you must use BoxCollider2D or it will not work. also on your player disable the gravity option on your rigidbody so stop it falling down at the start
Your answer
![](https://koobas.hobune.stream/wayback/20220611234848im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
3D box collider go through terrain 1 Answer
Rigidbodys 0 Answers
Collider going through walls with box collider.. 1 Answer
Transform.position with Box Collider? 4 Answers