Merge pull request #965 from max-torch/fix-hand-area-orientation-of-the-rotateplayermat-function

Fix player hand zone being upside down after using the rotate player mat function
This commit is contained in:
Chr1Z 2024-11-05 13:02:30 +01:00 committed by GitHub
commit b1b690d02e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -406,7 +406,14 @@ do
for guid, pos in pairs(storedPositions) do
local obj = getObjectFromGUID(guid)
obj.setPosition(mat.positionToWorld(pos))
obj.setRotation(obj.getRotation():setAt("y", rotationY))
-- offset the rotation by 180 degrees if the guid matches the player hand zones
local finalRotationY = rotationY
if obj.type == "Hand" then
finalRotationY = rotationY + 180
end
obj.setRotation(obj.getRotation():setAt("y", finalRotationY))
end
end