Mismatch between tool grip in property window and actual grip

Good morning all!

When I create a cframe and then set a tools grip to it, the grip appears to be different physically and in the property window, comapred to the cFrame it was set to.

simplified version of my tool script:

local tool : Tool
local r = math.rad

local playGrip = CFrame.fromEulerAnglesXYZ(r(35),r(70),0) + Vector3.new(0.6, -0.4, -0.4)

function PlayAnim()
	tool.Grip = playGrip
	
	print(tool.Grip:ToEulerAnglesXYZ())
	print(playGrip:ToEulerAnglesXYZ())
        -- both print `0.6108 1.2217 0`, which is 25 70 0 in deg
end

tool.Activated:Connect(function()
      PlayAnim()
end)

However, in the property window, it looks like this
image

Does anyone know what this is caused by and how to fix it? Thanks in advance!

1 Like

Okay, I figured it out and its kinda stupid. I’m goign to leave the solution here for a future generation of devs

For some reason, when I passed my Cframe into tool.Grip, it apparently flips my X and Y around?

Replace fromEulerAnglesXYZ with fromEulerAnglesYXZ. Not exactly sure why this bug happens or how this fixes it, but it works :+1:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.