Closed maccxs closed 4 years ago
Hey,
I tried lots of possibilities. I like this one for now. But feel free to try something else out. Do I have to do anything about the colliders now? If so what specifically? Thanks for the comments!
I guess we can leave the colliders as they are; at least I wouldn't know what to change.
Concerning the velocity: I tried that as well. But if they have less velocity the collision has less impulse and the stick together. Then, we would have to change the overall velocity. So far playing the game I find it ok.
@FredyHennig : What if in the OnTriggerEnter2D of the infection, we ask if the actual position +/- spritze size of the human is in the infection radius? Then the "outer collider" would not count. Since the NPCs now have another closer collider, this would trigger as well, when they are really within the infection radius.
Looks good to me. I did not have time to look at the code, but think @FredyHennig already did.
Think we can merge this, however i see two issues that may be changed in the future:
@FredyHennig : What if in the OnTriggerEnter2D of the infection, we ask if the actual position +/- spritze size of the human is in the infection radius? Then the "outer collider" would not count. Since the NPCs now have another closer collider, this would trigger as well, when they are really within the infection radius.
@maccxs Sorry, I'm afraid I can't quite follow... Do you intend to increase the size of the trigger zone and add an additional check for distance, and this way solve the invulnerability problem?
We still adjust the radius of the collider. But we attached a second collider that keeps the former "narrow radius" for collision. If NPC encounters the player or the map limits we disable the collision with collider1. It will still collide with collider2. In this way the NPCs keep their distance from each other but not from the walls or the player. In addition, we adjust the bounciness of collider1, since more social distancing makes us less bouncy. This should also result in a lower velocity for more social distance. More social distancing makes us crave less friction, so we adapt that value as well.