generated from Persson-dev/Godot-Xmake
fix position sync issues
This commit is contained in:
@@ -39,7 +39,7 @@ static const float AnimationBlend = 7.0;
|
||||
|
||||
void FirstPersonPlayer::_bind_methods() {}
|
||||
|
||||
FirstPersonPlayer::FirstPersonPlayer() : m_BobTime(0) {}
|
||||
FirstPersonPlayer::FirstPersonPlayer() : Player(), m_BobTime(0) {}
|
||||
|
||||
FirstPersonPlayer::~FirstPersonPlayer() {}
|
||||
|
||||
@@ -52,6 +52,9 @@ void FirstPersonPlayer::_ready() {
|
||||
m_Camera = Object::cast_to<Camera3D>(m_Head->find_child("Camera"));
|
||||
m_AnimationTree = Object::cast_to<AnimationTree>(find_child("AnimationTree"));
|
||||
m_Mesh = Object::cast_to<Node3D>(find_child("Mesh"));
|
||||
|
||||
set_position({0, 0, 0});
|
||||
set_velocity({0, 0, 0});
|
||||
}
|
||||
|
||||
void FirstPersonPlayer::_unhandled_input(const godot::Ref<godot::InputEvent>& a_Event) {
|
||||
@@ -89,9 +92,9 @@ void FirstPersonPlayer::_physics_process(float a_Delta) {
|
||||
UpdateFOV(a_Delta);
|
||||
UpdateBobbing(a_Delta);
|
||||
|
||||
UpdateAnimation(a_Delta);
|
||||
|
||||
move_and_slide();
|
||||
|
||||
UpdateAnimation(a_Delta);
|
||||
}
|
||||
|
||||
void FirstPersonPlayer::UpdateBobbing(float a_Delta) {
|
||||
|
||||
Reference in New Issue
Block a user