RespawnEnemy¶
This is a helper method to respawn an Enemy at a certain position. It takes in the NPCControl and the Vector3 position. The position will get incremented by Vector3.up * 0.5.
- entity.
destroytypeis set toSpinSmoke attackingis set to falsebehaviorroutineis stopped and set to null- All coroutines on the entity are stopped with entity.
deathcoroutineset to null - entity.
deadand entity.iskillare set to false - entity.
spinis zeroed out - entity.
rigidgravity is enabled without kinematic and with the velocity zeroed out - entity.
spriteis enabled and its angles set to zero - entity.animstate is set to the
basestate - entity.
overrideanimis set to false - entity.
ongroundis set to false - entity.
bobspeedand entity.bobrangeare reset to their start fields counterparts - entity.
lastposis set to the position passed as parameter - entity.
pauseposis set to null unless we arepausedin which case, it is also set to the passed position - StopForceMove is called
dizzytimeis set to 0.0respawntimeris set to -100.0freezecooldownis set to 0.0- Some SetPath exclusive logic occurs here
- entity.
ccolis enabled in without trigger hitis set to false- The position and the entity's
startposare set to the passed parameter - Some logic happens if the default behavior is a disguise one
- LockRigid(false) is called on the entity which unlocks its
rigid - The
pusheris enabled if it exist. NOTE: normally, enemies do not have one - DeathSmoke is called on the entity.
sprite's position