From 6691d670e23d8451dcceced958477aa3d3cbc578 Mon Sep 17 00:00:00 2001 From: Ethan Adams Date: Sat, 1 Mar 2025 13:05:30 -0500 Subject: [PATCH] Fixed followMouse bug layover from old origin point problem --- YuppleMayham/src/gameplay/gameactor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/YuppleMayham/src/gameplay/gameactor.cpp b/YuppleMayham/src/gameplay/gameactor.cpp index 9e02e46..01399c4 100644 --- a/YuppleMayham/src/gameplay/gameactor.cpp +++ b/YuppleMayham/src/gameplay/gameactor.cpp @@ -130,7 +130,7 @@ void GameActor::cycleWeapons(const MouseState& mouse_state) } void GameActor::followMouse(const MouseState& mouse_state) { - glm::vec2 direction = glm::vec2(mouse_state.x, mouse_state.y) - glm::vec2(localPosition.x + 0.5f * scale.x, localPosition.y + 0.5f * scale.y); + glm::vec2 direction = glm::vec2(mouse_state.x, mouse_state.y) - glm::vec2(localPosition.x, localPosition.y); float newRotation = glm::degrees(glm::atan(direction.y, direction.x)); if (getDirectionFromRotation(rotation) != getDirectionFromRotation(newRotation)) { if (auto event = sceneContext->getEventManager().lock()) {