diff --git a/src/client/FirstPersonPlayer.cpp b/src/client/FirstPersonPlayer.cpp index 492ef03..8892685 100644 --- a/src/client/FirstPersonPlayer.cpp +++ b/src/client/FirstPersonPlayer.cpp @@ -58,6 +58,8 @@ void FirstPersonPlayer::_ready() { m_Head->add_child(m_Camera); m_Camera->make_current(); + SetModelVisible(false); + SetPosition({0, 100, 0}); SetVelocity({0, 0, 0}); } diff --git a/src/client/Player.cpp b/src/client/Player.cpp index 938d4bc..5cf4eca 100644 --- a/src/client/Player.cpp +++ b/src/client/Player.cpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include #include #include @@ -98,7 +100,14 @@ void Player::BlendAnimation(const godot::String& a_AnimationName, float a_Goal, a_AnimationName, UtilityFunctions::lerp(m_AnimationTree->get(a_AnimationName), a_Goal, a_Delta * AnimationBlend)); } -void Player::SetModelVisible(bool visible) {} +void Player::SetModelVisible(bool a_Visible) { + auto* skeleton = m_Mesh->get_node("Skeleton3D"); + for (int i = 0; i < skeleton->get_child_count(); i++) { + auto* bodyPart = Object::cast_to(skeleton->get_child(i)); + bodyPart->set_cast_shadows_setting(a_Visible ? GeometryInstance3D::ShadowCastingSetting::SHADOW_CASTING_SETTING_ON + : GeometryInstance3D::ShadowCastingSetting::SHADOW_CASTING_SETTING_SHADOWS_ONLY); + } +} Vector3 Player::GetCameraRotation() const { return m_Player->get_rotation();