Skip to content

Commit

Permalink
Merge pull request #965 from max-torch/fix-hand-area-orientation-of-t…
Browse files Browse the repository at this point in the history
…he-rotateplayermat-function

Fix player hand zone being upside down after using the rotate player mat function
  • Loading branch information
Chr1Z93 authored Nov 5, 2024
2 parents 7d27903 + b8682f1 commit b1b690d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/playermat/PlayermatApi.ttslua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b1b690d

Please sign in to comment.