AnswerBun.com

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

Instantiate random different gameObjects in specific spaces?

1  Asked on November 2, 2021 by hapk

   

Gradual strafe rotation with focus on mouse (circle-strafe)

2  Asked on November 2, 2021 by lacklustertoady

       

Tile map click to walk UX

1  Asked on November 2, 2021

       

NiftyGUI – Text isn’t rendering

1  Asked on November 2, 2021 by ben-steffan

       

Move player in a circular manner

1  Asked on November 2, 2021 by renan-valentin-ferreira

   

Player hitting bottom of tile when beside it?

1  Asked on November 2, 2021 by mushrombrother-jpg

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir