fix attack angle

This commit is contained in:
Morph01
2024-08-20 16:49:18 +02:00
parent 1a14c78ede
commit 0c667944dd

View File

@@ -50,9 +50,11 @@ void Zombie::_process(float a_Delta) {
this->set_velocity(m_Velocity);
look_at(Vector3(this->get_global_position().x + this->get_velocity().x, this->get_global_position().y,
this->get_global_position().z + this->get_velocity().z));
} else if (m_StateMachine->get_current_node().match("Attack")) {
this->set_velocity(Vector3(0, 0, 0));
look_at(Vector3(m_Player->get_global_position().x, m_Player->get_global_position().y / 2, m_Player->get_global_position().z));
look_at(Vector3(m_Player->get_global_position().x + this->get_velocity().x, this->get_global_position().y,
m_Player->get_global_position().z + this->get_velocity().z));
}
m_AnimationTree->set("parameters/conditions/run", !_target_in_range());
m_AnimationTree->set("parameters/conditions/attack", _target_in_range());