So I’m trying to learn Inverse Kinematic stuff for keeping a hoverboard in place while looking like it’s being held. The problem is that I need to learn more about a specific thing which are apparently stuff like:
[insert CFrame value here].ZVector.Y Or [insert CFrame value here].XVector.Z
…
The problem being, the roblox reference API wiki says nothing about these topics, so I'm taking my question here to get answers. If it also helps, I can show a part of the code I'm using that's seemingly the problem.
runService.RenderStepped:Connect(function()
local reference = CFrame.new(0,0,0,1,0,0,0,1,0,0,0,1)
if running == true then
local look = CFrame.new(char.HumanoidRootPart.Position + char.HumanoidRootPart.CFrame:VectorToWorldSpace(Vector3.new(0,0,0)), char.RightHand.Position + char.HumanoidRootPart.CFrame:VectorToWorldSpace(Vector3.new(0,1,0)) )
local x,y,z = look:ToEulerAnglesXYZ()
motor6d.C0 = reference * CFrame.fromEulerAnglesXYZ(0,-math.asin(look.XVector.Z),-math.asin(look.ZVector.Y) * 0.5)
end
end)
This results in it rotating up and down just fine, but it turns on the X axis to the point it’s circling around the player!
If I could get an explanation on how to better visualize these axis vectors I’d have a much better time trying to do this…