Preventing player units from pushing enemies, and vice versa

Game Development Asked by Liad on January 14, 2021

I am using a Rigidbody2D to handle collision between different units.

When the player’s units encounter one another, they push each other because of the rigid body physics (and that’s good for me).

But when the player unit encounters an enemy unit, he pushes it in the same way.

What are the solutions to make enemy’s units unmovable by my units? (And my units unmovable for the enemy?)

(I know I could use isKinematic but I want the player’s units to keep interacting with each other.)

Add your own answers!

Related Questions

Resizing a tiledmap when using phaser

1  Asked on December 16, 2020 by sora


Prefab spawning issue

2  Asked on December 15, 2020 by usmaan-mahmood


Pause updating but keep rendering

1  Asked on December 5, 2020 by yosoku-denkai


How to make it so my cursor is not behind the UI?

0  Asked on December 3, 2020 by jacksonba90


Can’t submit facebook app for review

2  Asked on November 20, 2020 by moria


OpenGL Strange mesh when animating Assimp

1  Asked on October 26, 2020 by david-neves


2D Sidescroller Gravity

1  Asked on October 22, 2020 by pete-mavrelis


Can I “unmerge” merged meshes UE4?

0  Asked on September 22, 2020 by formatc2013


unity : How to delete unused assets?

0  Asked on September 6, 2020 by andio


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP