How to get local Cframe angle of a camera?
Hi.
This script gets deltas from the mouse, insert math into camera.CFrame along with collected deltas and make the camera angles move.
But it moves on the global axis...
1 | local function GetMouseMovement() |
2 | return xangle, yangle, 0 |
4 | game:GetService( "RunService" ).RenderStepped:connect( function () |
5 | local mousemovement = GetMouseMovement() |
6 | local HeadPosition = game.Players.LocalPlayer.Character.Head.Position |
7 | camera.CoordinateFrame = CFrame.new(HeadPosition) |
8 | camera.CFrame = camera.CFrame * CFrame.Angles(math.rad(-yangle), math.rad(-xangle), 0 ) |
What do I need to do to make it local.