I’m trying to get my 2D top down shooter to use -some- physics.
I want the player and enemies not be able to exist in the same position, in other words, use collisions.
My first attempt was to use a CharacterController, but I could not get my other game objects to collide with my player, even though I had a RigidBody2D and a BoxCollider2D on them. Obviously, due to using a CharacterController, I was not able to add these components on my player.
Going one step back, I removed the CharacterController, and rather opted to go the Rigidbody2D route. This worked partially. I now get collisions on my player when he walks into other gameobjects (with RB2D and BC2D on them), but there seems to be a “rebound” anomaly occurring; my player moves around after collision.
I’ve tried playing around with the settings on the RigidBody2D on the player, but it does not seem to have any effect.
I would like my player to stop dead in his tracks when colliding with another RigidBody2D. Is this possible? And if so, how would I go about doing that?