Hello,
I have this code in my game to rotate a gun:
if self.click then
self.angle = self.angle - 1
local rad_angle = math.rad(self.angle)
local rot_angle = vmath.quat_rotation_z(rad_angle)
go.set_rotation(rot_angle, self.line)
end
if self.angle < -90 then
self.angle = -90
end
but my gameobject is rotate 180 degrees in the editor and with vmath.quat_rotation_z I lost my rotation y.
how can rotate only z component?
Sorry for my english.
Regards.
Maxi.