Go.set_rotation 4th arguement issues (SOLVED)

So, I’m trying to make a sort of pickaxe, but it says I need a 4th argument. So, I just put in a 0. But, whenever I rotate the pickaxe with the 4th argument set, the screen just fills with the color of the handle. I tried setting a variable to the current rotation and using that as the 4th argument, but, still same thing. What is that 4th argument for, and what should I put there? Rotate code:

function on_input(self, action_id, action)
	if action_id == hash("click") then
		self.r = go.get_rotation()
		pick = true
		if action.released then
			pick = false

Edit: I’ve been messing around, and I managed to make it not cover the screen, but now the pickaxe just dissappears. Can anyone give me any way to rotate this dang pickaxe?

You’re mixing up quaternion and euler rotation. If you want to set the rotation in degrees, use the euler property like so:

-- "." means the current object
go.set(".", "euler", vmath.vector3(0, 0, -45))

Or, more simply:

go.set(".", "euler.z", -45)

Thanks! That works perfectly! Good to know that I should use eulers, not quaternions

1 Like

I think another takeaway is that euler rotation is different from quaternion rotation.
THey both have their pros and cons.