Hallo,
Ich versuche grad ein Script, mit welches man Objekte setzten grad leicht zu ändern.
Nun bin ich an mein Problem das ich das Objekt mit Bild auf und Bild ab + Das Mausrad die rz verändern kann.
Nun hab ich mich versucht das ich mit Bild auf und Bild up die Höhe verändern kann.
Dies hat leider nicht geklappt.
Ich hab für euch mal die Standart function wie sie vorher war.
Bin aber selber noch beim reinarbeiten der Function ^^.
Lua
local rotationAxis = "z"
function setRotationOfObject(button,state)
local object = tempOb[localPlayer]
if button == "arrow_u" or button == "arrow_d" then
if state then
rotationAxis="y"
else
rotationAxis="z"
end
elseif button == "arrow_r" or button == "arrow_l" then
if state then
rotationAxis="x"
else
rotationAxis="z"
end
end
if not state then return end
if button == "mouse_wheel_up" or button == "pgup" then
if rotationAxis == "z" then
local x,y,z = getElementRotation(object)
setElementRotation(object,x,y,z+5)
elseif rotationAxis == "y" then
local x,y,z = getElementRotation(object)
setElementRotation(object,x,y+5,z)
elseif rotationAxis == "x" then
local x,y,z = getElementRotation(object)
setElementRotation(object,x+5,y,z)
end
elseif button == "mouse_wheel_down" or button == "pgdn" then
if rotationAxis == "z" then
local x,y,z = getElementRotation(object)
setElementRotation(object,x,y,z-5)
elseif rotationAxis == "y" then
local x,y,z = getElementRotation(object)
setElementRotation(object,x,y-5,z)
elseif rotationAxis == "x" then
local x,y,z = getElementRotation(object)
setElementRotation(object,x-5,y,z)
end
end
end
Alles anzeigen