Announcing Section #2 for Survival Game - Weapons & Interaction

I don’t understand how that remote role works, but since it’s a backwards compatibility function, I guess it’s not worth to look into it, right ? :slight_smile:
Glad I could contribute by noticing this :slight_smile:

Do you mind if I keep asking questions ? There’s some stuff I still don’t understand how it’s linked (and I feel bad overlooking stuff, since it usually leads to taboos and other “it works, don’t touch it” issues).

How is the Respawn handled ?
I don’t know if this was changed in section 3 or 4 (I’m trying to understand how things works in section 2 for now, yet.)

I see a Die() function in the character. (I don’t see a reason for it to return a bool value, but I guess this is something that was planned for some future feature, right?)
It sets the killer, and call OnDeath() function, that:

  1. Apply the last tick of damage
  2. Apply momentum based on last shot (that for some reason I couldn’t figure out yet, makes the character get launched to the air, vertically o.O)
  3. Destroys the items contained in the inventory
  4. Removes control from the player, by un-possessing the pawn ( DetachFromControllerPendingDestroy() )
  5. Stop/Reset animations
  6. Handle collisions (I have a question about this below)
  7. Setup the Ragdoll by a custom function

Okay. This is how the player dies. How does it respawn?
I see a AHavenPlayerController::UnFreeze() function in there, but I don’t see it being called anywhere.
By inspecting PlayerController.h, I see this:


	/** Timer used by RoundEnded and Inactive states to accept player input again */
	virtual void UnFreeze();

I also noticed that it’s an empty function, so there’s no point in calling Super::UnFreeze() here.
I tried to dive a bit into the code, but… I think I got lost :frowning:
I currently have no idea what causes the player to respawn, and I also have no idea what to do if I wanted to modify this behavior, e.g.:

  • Delay the respawn by 5 seconds;
  • Make players respawn in waves;
  • Make a queue so a “new dead player” will only respawn after everyone in queue respawned - an item of this queue would be processed every 10 secs.

One thing that I noticed while I was writing the previous question is that you first disable the capsule collision then later you enable the actor collision inside OnDeath() function. Why this?
Initially I thought it was to avoid players from having fun shooting flying ragdolls, but collisions get re-enabled right after. I don’t get it.

Thank you again for your time and patience answering all these (odd?) doubts! :smiley: