I’m trying to use the world editor to determine rotation values for TSSTATIC objects I want to create in my mods lua code. World editor only shows the rotationEuler value (x,y,z). In lua code the .setField(‘rotation’ …) wants a quat. I’ve found that rotation object has a setFromEuler() but using it does not produce the same rotation in game as what’s shown in World editor. i know there is quatFromEuler() but again results do not produce same rotation of objects as shown in editor. what’s up?
To answer the question I know everyone is also wondering ... how to use World Editor rotationEuler(x,y,z) coordinates in obj.setField() ... how's the easy skinny ... Code: if rotation then -- rotation (vec3) x,y,z values from World Editor. -- convert to radians local radianVec3 = vec3(math.rad(rotation.x), math.rad(rotation.y), math.rad(rotation.z)) marker:setField('rotationEuler', 0, radianVec3.x .. ' ' .. radianVec3.y .. ' ' .. radianVec3.z) end