problem pointing my dragon's head torwed screen lookVector when character model rotates?
Hey guys! Am making a dragon! I've got this guy flying around with no animations yet so he is looking pretty stiff. So I decided to make his head move by facing where the screen faces.
basically, am using the motor6D's (in the head) cframe and setting it to point at the Camera.CFrame.lookVector. This works perfectly... until the dragon character turns then the head's rotation is off by how much the character turned from its original orientation.
Da Code,
01 | local UserInputService = game:GetService( "UserInputService" ) |
02 | game.Workspace:WaitForChild(game.Players.LocalPlayer.Name) |
03 | local player = game.Players.LocalPlayer |
04 | local character = player.Character |
05 | local Mouse = player:GetMouse() |
07 | local headMotor = character.Neck 4. Motor 6 D |
10 | local mouseP = Mouse.Hit.p |
11 | local direction = (-mouseP + character.Head.Position).Unit |
13 | headMotor.C 0 = CFrame.new(Vector 3. new( 0 , 0 , 0 ),-(workspace.CurrentCamera.CFrame.lookVector)) |
If anyone has ANY thoughts on how to cancel out the difference in rotation please let me know below. Maybe there's some way to make the rotation in local space or something? Plz help bring my Dragon to life! :D