WIP respawning.
This commit is contained in:
@@ -34,14 +34,23 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player)
|
||||
|
||||
//components that we need from player
|
||||
auto playerCamera = player.FirstChildByName("Camera");
|
||||
auto playerEntityModel = player.FirstChildByName("PlayerModel")["Model"];
|
||||
auto playerEntityAnimation = player.FirstChildByName("PlayerModel")["Animation"];
|
||||
auto playerModel = player.FirstChildByName("PlayerModel");
|
||||
if (!playerCamera.Valid() || !playerModel.Valid()) {
|
||||
return;
|
||||
}
|
||||
if (!playerModel.HasComponent("Model") || !playerModel.HasComponent("Animation")) {
|
||||
return;
|
||||
}
|
||||
auto playerEntityModel = playerModel["Model"];
|
||||
auto playerEntityAnimation = playerModel["Animation"];
|
||||
|
||||
//copy the data from player to explisioneffectmodel
|
||||
playerEntityModel.Copy(deathEffectEW["Model"]);
|
||||
playerEntityAnimation.Copy(deathEffectEW["Animation"]);
|
||||
//freeze the animation
|
||||
deathEffectEW["Animation"]["Speed"] = 0.0;
|
||||
deathEffectEW["Animation"]["Speed1"] = 0.0;
|
||||
deathEffectEW["Animation"]["Speed2"] = 0.0;
|
||||
deathEffectEW["Animation"]["Speed3"] = 0.0;
|
||||
|
||||
//copy the models position,orientation
|
||||
deathEffectEW["Transform"]["Position"] = (glm::vec3)player["Transform"]["Position"];
|
||||
|
||||
Reference in New Issue
Block a user