- Home /
Allow 2D character overlaps in side-scroller?
I have a player character with a rigidbody 2D, capsule collider 2D, and a player controller script. I have an ally character with a rigidbody 2D, capsule collider 2D, and an ally controller script. I want the ally character to always be standing / following behind the player character. However, currently when I try to turn around and walk to the other side of the ally character to lead them, I am colliding with them instead of passing infront of them. How can I let my player character overlap infront of my ally character so the player character can be infront no matter where I turn and run?
Answer by AlexanderZotov · May 16, 2019 at 05:35 AM
Set Order in layer option for the character to a higher value (e.g. Character - 2, Ally - 1) so Ally will be rendered behind the Character. Also, put them to different layers and disable collisions between those layers in Collision matrix.
Your answer
Follow this Question
Related Questions
Rigidbody collision movement similar to a wall 0 Answers
Using IgnoreLayerCollision and IgnoreCollision together 0 Answers
How to make a gameobject unaffected by time scale? 0 Answers
Dealing with rigidbody collisions when sending player positions across network 0 Answers
Is there a way to make a Rigidbody2D Ignore the TimeScale? 0 Answers