Hello!
I would I go about offsetting a CFrame rotation while still having the axis parallel to the offsetted axes follow it.
Example :
- If my default CFrame is
CFrame.Angles(0, 0, 45) and I offset it by CFrame.Angles(0, 90, 0) then it will become CFrame.Angles(45, 0, 0)
Could someone help me with that?
Thanks !
multiply the cframe by the rotation
CFrame *= CFrame.Angles(x,y,z)
but cframes use radians so in most cases you would be doing:
CFrame *= CFrame.Angles(math.rad(xDegrees), math.rad(yDegrees), math.rad(zDegrees))
I tried doing that and it looked to work but I see some strange behaviour happening.
I have pre-recorded values that I’m using to set the dummy shoulder orientation. These values comes from a phone orientation which is why I need to add an offset. This is the code I’m using : CFrame.fromEulerAnglesYXZ(X, Z, Y) * CFrame.Angles(math.rad(135), 0, 0).
This is what the mouvements should look like after the offset :
robloxapp-20220724-1146000.wmv
And this is what it looks like. You can kinda see that the two last moves are different from the one in the video above.
robloxapp-20220724-1146510.wmv
I’m asking here how could this be fixed as I am not really good with CFrames.