|
| 26 Dec 2015 08:52 PM |
Why doesn't this work, my camera just flips out. I am trying to make the camera trail behind the head, and also have the torso face the mouse.
local User = game.Players.LocalPlayer
repeat wait() until User
local Mouse = User:GetMouse() local Character = User.Character or User.CharacterAdded:wait()
local Head = Character.Head local Torso = Character.Torso
local Neck = Torso.Neck local Shoulder = Torso['Right Shoulder']
local Camera = workspace.CurrentCamera Camera.CameraType = Enum.CameraType.Scriptable
game:GetService('RunService').RenderStepped:connect(function() local Direction = (Torso.Position - Mouse.Hit.p).unit Torso.CFrame = CFrame.new(Torso.Position) * CFrame.Angles(0, math.atan2(Direction.X, Direction.Z) + 3.14, 0) Camera:Interpolate(Head.CFrame * CFrame.new(5, 10, 12), CFrame.new(Head.Position), 1 / 30) end)
"The butt-hurt is strong with this one" - GuyWithACleverName 2k15. |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 08:58 PM |
| Perhaps because the camera moving causes itself to move more. |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 09:01 PM |
2Jarod How do I fix it?
"The butt-hurt is strong with this one" - GuyWithACleverName 2k15. |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 09:04 PM |
Don't move the camera? Or just don't do it based on cursor position. |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 09:12 PM |
I narrowed it down: the problem is that the Camera is receiving the angles of the head, too. How do I stop that?
"The butt-hurt is strong with this one" - GuyWithACleverName 2k15. |
|
|
| Report Abuse |
|
|