[ AC v1.81.6 / Unity 2021.3.4f1 ]
I'm making a very basic top-down 2D game. I have a controllable player with a collider2d and a rigidbody2d, and the scene has a **navmesh **and that's it so far. I'm probably missing something basic here, but for the life of me I can't figure out why my player won't collide with a static box collider.
It successfully collides with the exact same object where the rigidbody2d is set to DYNAMIC (and the player can push it around). Additionally that DYNAMIC object will collide with the STATIC object if the player pushes it into it, but the player itself will not collide with the STATIC object directly. I also tried this with a default AC "Collision Cube 2D" still with no effect. The Player will also collide with the edge of the navmesh as expected.
The player has an AC "Player" script with default settings other than "Ignore Gravity" and "Auto-stick to navmesh" both checked. The rigidbody2D is set to kinematic, simulated. The box collider2D is not set to trigger.
Any help troubleshooting would be appreciated. I feel like I'm missing really basic here. Thanks!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
What's your game's Movement method, and does your Player have Move with Rigidbody 2D? checked in their Inspector?
If so, and the Rigidbody 2D is Kinematic, then they'll be moved using MovePosition. Otherwise, they'll rely on AddForce. Is there improvement if you uncheck Is Kinematic in the Rigidbody component?
Thanks for the fast reply! The movement method is keyboard WASD. I've tried with both the Move with Rigidbody2D checked on and off and still has no effect.
I did manage to get it working with the player rigidbody2D set to dynamic and then setting the gravity to 0. So maybe that's good enough for what I need.
Although it would still be nice to know how to get it working for a Kinematic Rigidbody on the player for future reference in case I run into issues with a Dynamic rigidbody.
Thanks again!