Open javier2409 opened 5 years ago
Found workaround You need to convert 'object' rotation in ZXY format to 'vehicle' rotation in ZYX format.
But I think the editor should give the rotation in ZYX format if the element is represented as a Vehicle
I don't sure if this is solution so i don't do pull request yet. Please check this:
function edfSetElementRotation(element, rx, ry, rz)
if rx and ry and rz then
local etype = getElementType(element)
if etype == "object" or etype == "vehicle" or etype == "player" or etype == "ped" then
return setElementRotation(element, rx, ry, rz)
else
local handle = edfGetHandle(element)
if handle then
return setElementRotation(handle, rx, ry, rz)
else
setElementData(element, "rotX", rx or 0)
setElementData(element, "rotY", ry or 0)
setElementData(element, "rotZ", rz or 0)
return true
end
end
end
end
if etype == "object" or etype == "vehicle" or etype == "player" or etype == "ped" then
return setElementRotation(element, rx, ry, rz) -- THIS
else
to
if etype == "object" or etype == "vehicle" or etype == "player" or etype == "ped" then
return setElementRotation(element, rx, ry, rz, etype == 'vehicle' and 'ZYX' or 'default') -- THIS
else
Which resource(s) have this problem? Not sure, edf, editor_main maybe
Describe the bug The rotation of a custom element represented by a vehicle seems to work differently than the rotation of an actual vehicle. For example, if I want to use that custom element's rotation to do something with real vehicles, It won't work as expected. This doesn't happen with all rotations.
To Reproduce
Expected behavior If I create a custom element represented by a vehicle it's rotation should match an actual vehicle rotation.
Screenshots See 'additional context'
Version 1.5.6
Additional context I made a forum post regarding this problem https://forum.mtasa.com/topic/117044-possible-editor-bug/