Closed knames closed 8 years ago
i haven't been able to reproduce this, seems to be working fine for me.
Having just been playing about with what is in develop I havn't noticed the turret thing, but it seems like zombies do not kill the newly spawned player until the player moves.
If the player hasn't moved, they'll just respawn at their current location. It might seem like he hasn't died, but he's probably just dying every frame. Maybe it's the same issue for the turret?
Ah sorry, I meant to also say that while not killing the player who hasn't moved yet, the zombie is also pushing the player away from the starting position. Then once I move the player out of contact with the zombie, any new collision between the two proper kills and respawns the player at the spawn point.
While being pushed, i can even move the player into the zombie without dieing, or up/down, as long as I am still touching it no death occurs.
Ah interesting, I see what you're saying.
So what seems to be happening is that the zombie kills the player when it first collides. However, because the player respawns in the same position, it doesn't detect another collision event. The way to fix this is to not have the player spawn with something already colliding with it, or else it wont detect a collision.
I can't reproduce the turret issue, but I'd assume it has the same cause.
Looks like we could also use OnCollisionStay2D, but I don't know what the performance implications of that are.
When a player is newly spawned, and a turret shoots at them, the object will not kill the player, but push it along the projectiles path.