Quantcast
Channel: Questions in topic: "mass"
Viewing all articles
Browse latest Browse all 157

Set player and enemy RigidBodies so that neither can push the other

$
0
0

I want to set up my RigidBodies such that my player and all enemies cannot move each other when interact. Right now, my player cannot be moved by enemies, but he can push enemies around very easily, as seen in this gif below:


https://gfycat.com/acclaimedsilvergopher


Right now, my game is set up such that both the player and the enemies have Dynamic RigidBodies, and the player has a mass of 10,000 while enemies have a mass of 1; thus, the player can push around the enemies but not vice versa.
I tried reversing the the masses such that it is the enemy who has a mass of 10,000 and then creating a script where the enemy will stop once it gets within a certain distance of the player, but when there are multiple enemies they end up pushing on each other and then pushing the player because. Writing a script to account for this becomes complicated.
Is there anyway to set up RigidBodies such that two Dynamic objects cannot push each other at all? Thanks!

Viewing all articles
Browse latest Browse all 157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>