diff --git a/[editor]/move_keyboard/move_keyboard.lua b/[editor]/move_keyboard/move_keyboard.lua index 416c85c41..48a9f7ba4 100644 --- a/[editor]/move_keyboard/move_keyboard.lua +++ b/[editor]/move_keyboard/move_keyboard.lua @@ -404,6 +404,9 @@ function attachElement(element) posX, posY, posZ = getElementPosition(element) movementType = MOVEMENT_MOVE + -- Clear the quat rotation when attaching to element + exports.editor_main:clearElementQuat(selectedElement) + if (getElementType(element) == "vehicle") or (getElementType(element) == "object") then rotX, rotY, rotZ = getElementRotation(element, "ZYX") elseif (getElementType(element) == "player") or (getElementType(element) == "ped") then @@ -420,6 +423,9 @@ function detachElement() if (selectedElement) then disable() + -- Clear the quat rotation when detaching from element + exports.editor_main:clearElementQuat(selectedElement) + -- fix for local elements if not isElementLocal(selectedElement) then -- sync position/rotation