So I get that math.asin is 1/math.sin and how this shows graphically in this post, but in this youtube video, it uses this script:
local camera = workspace.CurrentCamera
local character = game.Players.LocalPlayer.Character
local root = character:WaitForChild("HumanoidRootPart")
local neck = character:FindFirstChild("Neck", true)
local yOffset = neck.C0.Y
local CFNew, CFAng, asin = CFrame.new, CFrame.Angles, math.asin
game:GetService("RunService").RenderStepped:Connect(function()
local cameraDirection = root.CFrame:toObjectSpace(camera.CFrame).lookVector
if neck then
neck.C0 = CFNew(0 , yOffset, 0) * CFAng(0, -asin(cameraDirection.x), 0) * CFAng(asin(cameraDirection.y), 0, 0)
end
end)
to make headmovement with motor6D and math.asin. I don’t get how math.asin (1/math.sin) is used to accomplish this goal or really how it works in this situation. Someone explain please? Thanks for your time
Edit: I have also looked at some khan academy vids but i still cannot make sense of it